|
|
|
|
@ -3294,10 +3294,9 @@ string_view GetMonsterTypeText(const MonsterData &monsterData)
|
|
|
|
|
app_fatal(fmt::format("Unknown mMonstClass {}", static_cast<int>(monsterData.mMonstClass))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ActivateSpawn(int monsterId, Point position, Direction dir) |
|
|
|
|
void ActivateSpawn(Monster &monster, Point position, Direction dir) |
|
|
|
|
{ |
|
|
|
|
auto &monster = Monsters[monsterId]; |
|
|
|
|
dMonster[position.x][position.y] = monsterId + 1; |
|
|
|
|
dMonster[position.x][position.y] = monster.getId() + 1; |
|
|
|
|
monster.position.tile = position; |
|
|
|
|
monster.position.future = position; |
|
|
|
|
monster.position.old = position; |
|
|
|
|
@ -4718,9 +4717,11 @@ bool SpawnSkeleton(int ii, Point position)
|
|
|
|
|
if (ii == -1) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
Monster &monster = Monsters[ii]; |
|
|
|
|
|
|
|
|
|
if (IsTileAvailable(position)) { |
|
|
|
|
Direction dir = GetDirection(position, position); // TODO useless calculation
|
|
|
|
|
ActivateSpawn(ii, position, dir); |
|
|
|
|
ActivateSpawn(monster, position, dir); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -4760,7 +4761,7 @@ bool SpawnSkeleton(int ii, Point position)
|
|
|
|
|
|
|
|
|
|
Point spawn = position + Displacement { x2 - 1, y2 - 1 }; |
|
|
|
|
Direction dir = GetDirection(spawn, position); |
|
|
|
|
ActivateSpawn(ii, spawn, dir); |
|
|
|
|
ActivateSpawn(monster, spawn, dir); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|