Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Temporary fix for bouncers moving back to their spawn point

(Also updated .gitignore to add .DS_Store* as I am on a mac)
  • Loading branch information...
commit df1f1b22d6821edb5019df892109027d02456571 1 parent 80526af
@evanschoffstall evanschoffstall authored
Showing with 11 additions and 5 deletions.
  1. +1 −0  .gitignore
  2. +10 −5 src/guard/net/citizensnpcs/guards/types/Bouncer.java
View
1  .gitignore
@@ -8,3 +8,4 @@
\doc
/doc
Citizens.jar
+.DS_Store*
View
15 src/guard/net/citizensnpcs/guards/types/Bouncer.java
@@ -16,14 +16,19 @@ private boolean continueReturn(HumanNPC npc) {
return !LocationUtils.withinRange(npc.getLocation(), npc.getBaseLocation(), 3.5);
}
- private boolean findTarget(HumanNPC npc) {
+ private boolean findTarget(HumanNPC npc)
+ {
Guard guard = npc.getType("guard");
if (!guard.isAggressive())
return false;
- LivingEntity entity = Targeter
- .findTarget(Targeter.getNearby(npc.getPlayer(), guard.getProtectionRadius()), npc);
- if (entity != null
- && LocationUtils.withinRange(entity.getLocation(), npc.getBaseLocation(), guard.getProtectionRadius())) {
+ LivingEntity entity = Targeter.findTarget(Targeter.getNearby(npc.getPlayer(), guard.getProtectionRadius()), npc);
+ if (entity != null && LocationUtils.withinRange(entity.getLocation(), npc.getBaseLocation(), guard.getProtectionRadius()))
+ {
+ if (entity.isDead())
+ {
+ return false;
+ }
+
guard.target(entity, npc);
return true;
}

0 comments on commit df1f1b2

Please sign in to comment.
Something went wrong with that request. Please try again.