Fix map spawn
Fix map failing to spawn in some cases.
This commit is contained in:
@@ -439,14 +439,15 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
eventInstance.monsterKilled(this);
|
||||
}
|
||||
}
|
||||
// idk V just a troll
|
||||
|
||||
MapleCharacter looter = map.getCharacterById(getHighestDamagerId());
|
||||
return looter != null ? looter : killer;
|
||||
}
|
||||
|
||||
public void dispatchMonsterKilled() {
|
||||
for (MonsterListener listener : listeners.toArray(new MonsterListener[listeners.size()])) {
|
||||
listener.monsterKilled(getAnimationTime("die1"));
|
||||
}
|
||||
|
||||
MapleCharacter looter = map.getCharacterById(getHighestDamagerId());
|
||||
|
||||
return looter != null ? looter : killer;
|
||||
}
|
||||
|
||||
// should only really be used to determine drop owner
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.awt.Point;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class SpawnPoint {
|
||||
|
||||
private int monster, mobTime, team, fh, f;
|
||||
private Point pos;
|
||||
private long nextPossibleSpawn;
|
||||
@@ -45,9 +44,17 @@ public class SpawnPoint {
|
||||
this.mobInterval = mobInterval;
|
||||
this.nextPossibleSpawn = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public int getSpawned() {
|
||||
return spawnedMonsters.intValue();
|
||||
}
|
||||
|
||||
public void denySpawn(boolean val) {
|
||||
spawnedMonsters.set((val == false) ? 0 : 1);
|
||||
}
|
||||
|
||||
public boolean shouldSpawn() {
|
||||
if (mobTime < 0 || ((mobTime != 0 || immobile) && spawnedMonsters.get() > 0) || spawnedMonsters.get() > 2) {//lol
|
||||
if (mobTime < 0 || spawnedMonsters.get() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,7 +62,7 @@ public class SpawnPoint {
|
||||
}
|
||||
|
||||
public boolean shouldForceSpawn() {
|
||||
if (mobTime < 0 || ((mobTime != 0 || immobile) && spawnedMonsters.get() > 0) || spawnedMonsters.get() > 2) {//lol
|
||||
if (mobTime < 0 || spawnedMonsters.get() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -98,4 +105,12 @@ public class SpawnPoint {
|
||||
public final int getFh() {
|
||||
return fh;
|
||||
}
|
||||
|
||||
public int getMobTime() {
|
||||
return mobTime;
|
||||
}
|
||||
|
||||
public int getTeam() {
|
||||
return team;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user