mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Compare commits
2 Commits
3365cb53b7
...
8568fd1c46
Author | SHA1 | Date | |
---|---|---|---|
8568fd1c46 | |||
05a5303522 |
@ -478,6 +478,14 @@ void MobAI::deadStep(CombatNPC* npc, time_t currTime) {
|
||||
if (self->groupLeader == self->id)
|
||||
roamingStep(self, currTime);
|
||||
|
||||
/*
|
||||
* If the mob hasn't fully despanwed yet, don't try to respawn it. This protects
|
||||
* against the edge case where mobs with a very short regenTime would try to respawn
|
||||
* before they've faded away; and would respawn even if they were meant to be removed.
|
||||
*/
|
||||
if (!self->despawned)
|
||||
return;
|
||||
|
||||
if (self->killedTime != 0 && currTime - self->killedTime < self->regenTime * 100)
|
||||
return;
|
||||
|
||||
|
@ -388,8 +388,21 @@ NPCPath* Transport::findApplicablePath(int32_t id, int32_t type, int taskID) {
|
||||
|
||||
void Transport::constructPathNPC(int32_t id, NPCPath* path) {
|
||||
BaseNPC* npc = NPCManager::NPCs[id];
|
||||
if (npc->kind == EntityKind::MOB)
|
||||
((Mob*)(npc))->staticPath = true;
|
||||
|
||||
if (npc->kind == EntityKind::MOB) {
|
||||
auto mob = (Mob*)npc;
|
||||
mob->staticPath = true;
|
||||
|
||||
Vec3 firstPoint = path->points.front();
|
||||
|
||||
// Ensure that the first point coincides with the mob's spawn point.
|
||||
if (mob->spawnX != firstPoint.x || mob->spawnY != firstPoint.y) {
|
||||
std::cout << "[FATAL] The first point of the route for mob " << mob->id << " (type " << mob->type
|
||||
<< ") does not correspond with its spawn point." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
npc->loopingPath = path->isLoop;
|
||||
|
||||
// Interpolate
|
||||
|
Loading…
Reference in New Issue
Block a user