Add npc configs entry for ignoring tolerance
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package core.game.node.entity.npc.agg;
|
||||
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import rs09.ServerConstants;
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.combat.DeathTask;
|
||||
@@ -187,7 +188,11 @@ public final class AggressiveHandler {
|
||||
* @return The allowTolerance.
|
||||
*/
|
||||
public boolean isAllowTolerance() {
|
||||
return allowTolerance;
|
||||
boolean configSetting = true;
|
||||
if(entity instanceof NPC){
|
||||
configSetting = ((NPC) entity).getDefinition().getConfiguration("can_tolerate", true);
|
||||
}
|
||||
return allowTolerance && configSetting;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -257,6 +257,7 @@ NPCConfigParser {
|
||||
"poisonous",
|
||||
"poison_immune",
|
||||
"facing_booth",
|
||||
"can_tolerate",
|
||||
"water_npc"-> configs.put(it.key.toString(), it.value.toString().toBoolean())
|
||||
else -> SystemLogger.logWarn("Unhandled key for npc config: ${it.key.toString()}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user