Ver Fonte

Fixed Random Spawns (#8397)

- Fixed monsters with random spawn location to sometimes spawn on (0,0) if that cell is not a wall
- Follow-up to 5d232db
Playtester há 1 ano atrás
pai
commit
23e7e1f367
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      src/map/npc.cpp

+ 2 - 1
src/map/npc.cpp

@@ -5323,7 +5323,8 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c
 	if (battle_config.force_random_spawn || (mob.x == 0 && mob.y == 0)
 		|| (mob.xs == 1 && mob.ys == 1 && !map_getcell(mob.m, mob.x, mob.y, CELL_CHKREACH)))
 	{	//Force a random spawn anywhere on the map.
-		mob.x = mob.y = 0;
+		// Set x and y to -1 to prevent fallback spawn on cell 0,0
+		mob.x = mob.y = -1;
 		mob.xs = mob.ys = 0;
 	}