If a grid is not assigned to a spawn then we will try to force one on the map if they are not a flying creature
This commit is contained in:
parent
ce6ad0e2a3
commit
c177dc910d
@ -2986,7 +2986,17 @@ void ZoneServer::DeterminePosition(SpawnLocation* spawnlocation, Spawn* spawn){
|
|||||||
spawn->SetSpawnOrigHeading(spawn->GetHeading());
|
spawn->SetSpawnOrigHeading(spawn->GetHeading());
|
||||||
spawn->SetSpawnOrigPitch(spawnlocation->pitch);
|
spawn->SetSpawnOrigPitch(spawnlocation->pitch);
|
||||||
spawn->SetSpawnOrigRoll(spawnlocation->roll);
|
spawn->SetSpawnOrigRoll(spawnlocation->roll);
|
||||||
|
|
||||||
|
int32 grid = spawnlocation->grid_id;
|
||||||
spawn->SetLocation(spawnlocation->grid_id);
|
spawn->SetLocation(spawnlocation->grid_id);
|
||||||
|
if(grid == 0 && !spawn->IsFlyingCreature()) {
|
||||||
|
Map* zonemap = world.GetMap(std::string(GetZoneFile()),0);
|
||||||
|
if(zonemap) {
|
||||||
|
auto loc = glm::vec3(spawn->GetX(), spawn->GetZ(), spawn->GetY());
|
||||||
|
float new_y = zonemap->FindBestZ(loc, nullptr, nullptr, &grid);
|
||||||
|
spawn->SetLocation(grid);
|
||||||
|
}
|
||||||
|
}
|
||||||
spawn->SetSpawnLocationPlacementID(spawnlocation->placement_id);
|
spawn->SetSpawnLocationPlacementID(spawnlocation->placement_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user