Browse Source

Consolidate use of grid_id and use SetLocation / GetLocation

Emagi 1 year ago
parent
commit
56c51b6759

+ 5 - 7
EQ2/source/WorldServer/Bots/BotCommands.cpp

@@ -198,10 +198,8 @@ void Commands::Command_Bot(Client* client, Seperator* sep) {
 								continue;
 							
 							if (member->IsBot() && ((Bot*)member)->GetOwner() == player) {
-								if(member->GetZone() && member->appearance.pos.grid_id != player->appearance.pos.grid_id) {
-									member->GetZone()->RemoveSpawnFromGrid(member, member->appearance.pos.grid_id);
-									member->appearance.pos.grid_id = player->appearance.pos.grid_id;
-									member->GetZone()->AddSpawnToGrid(member, member->appearance.pos.grid_id);
+								if(member->GetZone() && member->GetLocation() != player->GetLocation()) {
+									member->SetLocation(player->GetLocation());
 								}
 								member->SetX(player->GetX());
 								member->SetY(player->GetY());
@@ -223,7 +221,7 @@ void Commands::Command_Bot(Client* client, Seperator* sep) {
 					Bot* bot = (Bot*)client->GetPlayer()->GetTarget();
 					Player* player = client->GetPlayer();
 					if (bot && bot->GetOwner() == player) {
-						bot->appearance.pos.grid_id = player->appearance.pos.grid_id;
+						bot->SetLocation(player->GetLocation());
 						bot->SetX(player->GetX());
 						bot->SetY(player->GetY());
 						bot->SetZ(player->GetZ());
@@ -430,7 +428,7 @@ void Commands::Command_Bot_Create(Client* client, Seperator* sep) {
 			bot->SetSpawnOrigY(bot->GetY());
 			bot->SetSpawnOrigZ(bot->GetZ());
 			bot->SetSpawnOrigHeading(bot->GetHeading());
-			bot->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+			bot->SetLocation(client->GetPlayer()->GetLocation());
 			bot->SetInitialState(16512);
 			bot->SetModelType(id_list->at(0));
 			bot->SetAdventureClass(advClass);
@@ -537,7 +535,7 @@ void Commands::Command_Bot_Spawn(Client* client, Seperator* sep) {
 			bot->SetSpawnOrigY(bot->GetY());
 			bot->SetSpawnOrigZ(bot->GetZ());
 			bot->SetSpawnOrigHeading(bot->GetHeading());
-			bot->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+			bot->SetLocation(client->GetPlayer()->GetLocation());
 			bot->SetInitialState(16512);
 			bot->SetLevel(client->GetPlayer()->GetLevel());
 			bot->SetEncounterLevel(6);

+ 10 - 10
EQ2/source/WorldServer/Commands/Commands.cpp

@@ -3919,8 +3919,8 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 					spawn->appearance.targetable = 1;
 					spawn->appearance.activity_status = ACTIVITY_STATUS_SOLID;
 					spawn->appearance.race = item && item->generic_info.appearance_id ? item->generic_info.appearance_id : 1472;
-					spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
 					spawn->SetModelType(item && item->generic_info.appearance_id ? item->generic_info.appearance_id : 1472);
+					spawn->SetLocation(client->GetPlayer()->GetLocation());
 					spawn->SetZone(client->GetCurrentZone());
 					client->SetTempPlacementSpawn(spawn);
 					client->SetPlacementUniqueItemID(uniqueid);
@@ -4584,14 +4584,14 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 				((Sign*)spawn)->SetWidgetX(client->GetPlayer()->GetX());
 				((Sign*)spawn)->SetWidgetY(client->GetPlayer()->GetY());
 				((Sign*)spawn)->SetWidgetZ(client->GetPlayer()->GetZ());
-				spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				spawn->SetLocation(client->GetPlayer()->GetLocation());
 				spawn->appearance.model_type = atoul(sep->arg[1]);
 			}
 			else
 			{
 				spawn->appearance.targetable = 1;
 				spawn->appearance.race = 255;
-				spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				spawn->SetLocation(client->GetPlayer()->GetLocation());
 				spawn->SetModelType(atoi(sep->arg[1]));
 				spawn->SetAdventureClass(atoi(sep->arg[2]));
 				spawn->SetLevel(atoi(sep->arg[3]));
@@ -5198,9 +5198,9 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 			spawn->SetSpawnOrigZ(spawn->GetZ());
 			spawn->SetSpawnOrigHeading(spawn->GetHeading());
 			if(sep && sep->arg[5][0])
-				spawn->appearance.pos.grid_id = atol(sep->arg[5]);
+				spawn->SetLocation(atoul(sep->arg[5]));
 			else
-				spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				spawn->SetLocation(client->GetPlayer()->GetLocation());
 
 			if(spawn->IsNPC() && spawn->GetTotalHP() == 0){
 				spawn->SetTotalHP(spawn->GetLevel() * 15);
@@ -6183,7 +6183,7 @@ void Commands::Command_Grid(Client* client, Seperator* sep)
 			client->GetCurrentZone()->SendClientSpawnListInGrid(client, grid);
 		}
 		else {
-			client->Message(CHANNEL_COLOR_YELLOW, "Your Grid ID is %u", client->GetPlayer()->appearance.pos.grid_id);
+			client->Message(CHANNEL_COLOR_YELLOW, "Your Grid ID is %u", client->GetPlayer()->GetLocation());
 			auto loc = glm::vec3(client->GetPlayer()->GetX(), client->GetPlayer()->GetZ(), client->GetPlayer()->GetY());
 			uint32 GridID = 0;
 			uint32 WidgetID = 0;
@@ -7321,7 +7321,7 @@ void Commands::Command_LocationCreate(Client* client, Seperator* sep)
 		if (sep->arg[1] && sep->IsNumber(1) && atoi(sep->arg[1]) > 0)
 			include_y = true;
 
-		int32 location_id = database.CreateLocation(client->GetPlayer()->GetZone()->GetZoneID(), client->GetPlayer()->appearance.pos.grid_id, name, include_y);
+		int32 location_id = database.CreateLocation(client->GetPlayer()->GetZone()->GetZoneID(), client->GetPlayer()->GetLocation(), name, include_y);
 
 		if (location_id > 0)
 			client->Message(CHANNEL_COLOR_YELLOW, "Location '%s' was successfully created with location id %u", name, location_id);
@@ -9891,7 +9891,7 @@ void Commands::Command_Test(Client* client, EQ2_16BitString* command_parms) {
 				spawn->SetSpawnOrigY(spawn->GetY());
 				spawn->SetSpawnOrigZ(spawn->GetZ());
 				spawn->SetSpawnOrigHeading(spawn->GetHeading());
-				spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				spawn->SetLocation(client->GetPlayer()->GetLocation());
 				spawn->appearance.targetable = 1;
 				if (spawn->IsNPC() && spawn->GetTotalHP() == 0) {
 					spawn->SetTotalHP(spawn->GetLevel() * 15);
@@ -9926,7 +9926,7 @@ void Commands::Command_Test(Client* client, EQ2_16BitString* command_parms) {
 				spawn->SetSpawnOrigY(spawn->GetY());
 				spawn->SetSpawnOrigZ(spawn->GetZ());
 				spawn->SetSpawnOrigHeading(spawn->GetHeading());
-				spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				spawn->SetLocation(client->GetPlayer()->GetLocation());
 				spawn->appearance.targetable = 1;
 				if (spawn->IsNPC() && spawn->GetTotalHP() == 0) {
 					spawn->SetTotalHP(spawn->GetLevel() * 15);
@@ -10614,7 +10614,7 @@ void Commands::Command_Test(Client* client, EQ2_16BitString* command_parms) {
 				float x = atof(sep->arg[2]);
 				float y = atof(sep->arg[3]);
 				float z = atof(sep->arg[4]);
-				new_spawn->appearance.pos.grid_id = client->GetPlayer()->appearance.pos.grid_id;
+				new_spawn->SetLocation(client->GetPlayer()->GetLocation());
 				new_spawn->SetWidgetX(x);
 				new_spawn->SetWidgetY(y);
 				new_spawn->SetWidgetZ(z);

+ 1 - 1
EQ2/source/WorldServer/GroundSpawn.cpp

@@ -290,7 +290,7 @@ void GroundSpawn::ProcessHarvest(Client* client) {
 						continue;
 
 					// if the grid_id on the item matches player grid, or is 0, keep the item
-					if (!entry->grid_id || (entry->grid_id == client->GetPlayer()->appearance.pos.grid_id)) {
+					if (!entry->grid_id || (entry->grid_id == client->GetPlayer()->GetLocation())) {
 						// build modified entries table
 						if ((entry->is_rare == 1 && harvest_type == 5) || (entry->is_rare == 1 && harvest_type == 6)) {
 							// if the matching item is rare, or harvest10 push to mod rares

+ 6 - 11
EQ2/source/WorldServer/Player.cpp

@@ -3347,8 +3347,6 @@ void Player::PrepareIncomingMovementPacket(int32 len, uchar* data, int16 version
 				boat_x -= boat->GetX();
 				boat_y -= boat->GetY();
 				boat_z -= boat->GetZ();
-
-				//appearance.pos.grid_id = grid_id;
 			}
 		}
 
@@ -3356,7 +3354,7 @@ void Player::PrepareIncomingMovementPacket(int32 len, uchar* data, int16 version
 		SetBoatY(boat_y);
 		SetBoatZ(boat_z);
 		pos_packet_speed = speed;
-		grid_id = appearance.pos.grid_id;
+		grid_id = GetLocation();
 	}
 	else if (GetBoatSpawn() > 0 && !lift_cooldown.Enabled())
 	{
@@ -3400,23 +3398,20 @@ void Player::PrepareIncomingMovementPacket(int32 len, uchar* data, int16 version
 		}
 	}
 
-	if (appearance.pos.grid_id != grid_id)
+	if (GetLocation() != grid_id)
 	{
-		LogWrite(PLAYER__DEBUG, 0, "Player", "%s left grid %u and entered grid %u", appearance.name, appearance.pos.grid_id, grid_id);
+		LogWrite(PLAYER__DEBUG, 0, "Player", "%s left grid %u and entered grid %u", appearance.name, GetLocation(), grid_id);
 		const char* zone_script = world.GetZoneScript(GetZone()->GetZoneID());
 
 		if (zone_script && lua_interface) {
 			lua_interface->RunZoneScript(zone_script, "leave_location", GetZone(), this, GetLocation());
 		}
 		
-			GetZone()->RemoveSpawnFromGrid(this, GetLocation());
-			GetZone()->AddSpawnToGrid(this, grid_id);
-			
+		SetLocation(grid_id);
+		
 		if (zone_script && lua_interface) {
 			lua_interface->RunZoneScript(zone_script, "enter_location", GetZone(), this, grid_id);
 		}
-		
-		appearance.pos.grid_id = grid_id;
 	}
 	if (activity == UPDATE_ACTIVITY_IN_WATER_ABOVE || activity == UPDATE_ACTIVITY_IN_WATER_BELOW ||
 		activity == UPDATE_ACTIVITY_MOVE_WATER_BELOW_AOM || activity == UPDATE_ACTIVITY_MOVE_WATER_ABOVE_AOM) {
@@ -6536,7 +6531,7 @@ NPC* Player::InstantiateSpiritShard(float origX, float origY, float origZ, float
 		npc->SetSpawnOrigY(origY);
 		npc->SetSpawnOrigZ(origZ);
 		npc->SetSpawnOrigHeading(origHeading);
-		npc->appearance.pos.grid_id = origGridID;
+		npc->SetLocation(origGridID);
 		const char* script = rule_manager.GetGlobalRule(R_Combat, SpiritShardSpawnScript)->GetString();
 
 		int32 dbid = database.CreateSpiritShard(newName.c_str(), GetLevel(), GetRace(), GetGender(), GetAdventureClass(), GetModelType(), GetSogaModelType(), 

+ 17 - 15
EQ2/source/WorldServer/Spawn.cpp

@@ -257,8 +257,10 @@ void Spawn::InitializeHeaderPacketData(Player* player, PacketStruct* header, int
 void Spawn::InitializeVisPacketData(Player* player, PacketStruct* vis_packet) {
 	int16 version = vis_packet->GetVersion();
 
-	if (IsPlayer())
+//why?
+	/*if (IsPlayer()) {
 		appearance.pos.grid_id = 0xFFFFFFFF;
+	}*/
 
 	int8 tag_icon = 0;
 
@@ -2078,7 +2080,7 @@ void Spawn::InitializePosPacketData(Player* player, PacketStruct* packet, bool b
 		m_GridMutex.releasewritelock(__FUNCTION__, __LINE__);
 	}
 	
-	packet->setDataByName("pos_grid_id", new_grid_id != 0 ? new_grid_id : appearance.pos.grid_id);
+	packet->setDataByName("pos_grid_id", new_grid_id != 0 ? new_grid_id : GetLocation());
 	bool include_heading = true;
 	if (IsWidget() && ((Widget*)this)->GetIncludeHeading() == false)
 		include_heading = false;
@@ -3354,7 +3356,7 @@ bool Spawn::CalculateChange(){
 				SetY(ny + tar_vy, false);
 		}
 	
-		int32 newGrid = appearance.pos.grid_id;
+		int32 newGrid = GetLocation();
 		if (GetMap() != nullptr) {
 			m_GridMutex.writelock(__FUNCTION__, __LINE__);
 			std::map<int32,TimedGridData>::iterator itr = established_grid_id.begin();
@@ -3383,7 +3385,7 @@ bool Spawn::CalculateChange(){
 			m_GridMutex.releasewritelock(__FUNCTION__, __LINE__);
 		}
 
-		if ((!IsFlyingCreature() || IsTransportSpawn()) && newGrid != 0 && newGrid != appearance.pos.grid_id)
+		if ((!IsFlyingCreature() || IsTransportSpawn()) && newGrid != 0 && newGrid != GetLocation())
 			SetLocation(newGrid);
 	}
 	return remove_needed;
@@ -3944,8 +3946,8 @@ void Spawn::FixZ(bool forceUpdate) {
 	if(GetMap() != nullptr) {
 		float new_z = GetMap()->FindBestZ(current_loc, nullptr, &GridID, &WidgetID);
 
-		if ((IsTransportSpawn() || !IsFlyingCreature()) && GridID != 0 && GridID != appearance.pos.grid_id) {
-			LogWrite(PLAYER__DEBUG, 0, "Player", "%s left grid %u and entered grid %u", appearance.name, appearance.pos.grid_id, GridID);
+		if ((IsTransportSpawn() || !IsFlyingCreature()) && GridID != 0 && GridID != GetLocation()) {
+			LogWrite(PLAYER__DEBUG, 0, "Player", "%s left grid %u and entered grid %u", appearance.name, GetLocation(), GridID);
 			
 			const char* zone_script = world.GetZoneScript(GetZone()->GetZoneID());
 
@@ -3953,14 +3955,11 @@ void Spawn::FixZ(bool forceUpdate) {
 				lua_interface->RunZoneScript(zone_script, "leave_location", GetZone(), this, GetLocation());
 			}
 			
-				GetZone()->RemoveSpawnFromGrid(this, GetLocation());
-				GetZone()->AddSpawnToGrid(this, GridID);
+			SetLocation(GridID);
 				
 			if (zone_script && lua_interface) {
 				lua_interface->RunZoneScript(zone_script, "enter_location", GetZone(), this, GridID);
 			}
-			
-			SetPos(&appearance.pos.grid_id, GridID);
 		}
 		trigger_widget_id = WidgetID;
 	}
@@ -3974,7 +3973,7 @@ void Spawn::FixZ(bool forceUpdate) {
 	{
 		glm::vec3 targPos(GetX(), GetY(), GetZ());
 		
-		if(region_map->InWater(targPos, appearance.pos.grid_id))
+		if(region_map->InWater(targPos, GetLocation()))
 			return;
 	}
 	
@@ -4217,7 +4216,7 @@ bool Spawn::InWater()
 			if ( IsGroundSpawn() )
 				targPos.y -= .5f;
 					
-			if(region_map->InWater(targPos, appearance.pos.grid_id))
+			if(region_map->InWater(targPos, GetLocation()))
 				inWater = true;
 		}
 
@@ -4234,7 +4233,7 @@ bool Spawn::InLava()
 			if ( IsGroundSpawn() )
 				targPos.y -= .5f;
 					
-			if(region_map->InLava(targPos, appearance.pos.grid_id))
+			if(region_map->InLava(targPos, GetLocation()))
 				inLava = true;
 		}
 
@@ -4505,8 +4504,11 @@ bool Spawn::HasRegionTracked(Region_Node* node, ZBSP_Node* bsp_root, bool in_reg
 void Spawn::SetLocation(int32 id, bool setUpdateFlags)
 {
 	if(GetZone()) {
-		GetZone()->RemoveSpawnFromGrid(this, appearance.pos.grid_id);
+		GetZone()->RemoveSpawnFromGrid(this, GetLocation());
+		SetPos(&appearance.pos.grid_id, id, setUpdateFlags);
 		GetZone()->AddSpawnToGrid(this, id);
 	}
-	SetPos(&appearance.pos.grid_id, id, setUpdateFlags);
+	else {
+		SetPos(&appearance.pos.grid_id, id, setUpdateFlags);
+	}
 }

+ 3 - 3
EQ2/source/WorldServer/WorldDatabase.cpp

@@ -1185,7 +1185,7 @@ void WorldDatabase::LoadSpiritShards(ZoneServer* zone){
 		shard->SetSpawnOrigY(shard->GetY());
 		shard->SetSpawnOrigZ(shard->GetZ());
 		shard->SetSpawnOrigHeading(shard->GetHeading());
-		shard->appearance.pos.grid_id = atoul(row[32]);
+		shard->SetLocation(atoul(row[32]));
 		shard->SetShardID(atoul(row[33]));
 		shard->SetShardCharID(atoul(row[34]));
 
@@ -3339,7 +3339,7 @@ void WorldDatabase::LoadSpawns(ZoneServer* zone)
 bool WorldDatabase::UpdateSpawnLocationSpawns(Spawn* spawn) {
 	Query query;
 	query.RunQuery2(Q_UPDATE, "update spawn_location_placement set x=%f, y=%f, z=%f, heading=%f, x_offset=%f, y_offset=%f, z_offset=%f, respawn=%u, expire_timer=%u, expire_offset=%u, grid_id=%u, pitch=%f, roll=%f where id = %u",
-		spawn->GetX(), spawn->GetY(), spawn->GetZ(), spawn->GetHeading(), spawn->GetXOffset(), spawn->GetYOffset(), spawn->GetZOffset(), spawn->GetRespawnTime(), spawn->GetExpireTime(), spawn->GetExpireOffsetTime(), spawn->appearance.pos.grid_id, spawn->GetPitch(), spawn->GetRoll(), spawn->GetSpawnLocationPlacementID());
+		spawn->GetX(), spawn->GetY(), spawn->GetZ(), spawn->GetHeading(), spawn->GetXOffset(), spawn->GetYOffset(), spawn->GetZOffset(), spawn->GetRespawnTime(), spawn->GetExpireTime(), spawn->GetExpireOffsetTime(), spawn->GetLocation(), spawn->GetPitch(), spawn->GetRoll(), spawn->GetSpawnLocationPlacementID());
 	if (query.GetErrorNumber() && query.GetError() && query.GetErrorNumber() < 0xFFFFFFFF) {
 		LogWrite(WORLD__ERROR, 0, "World", "Error in UpdateSpawnLocationSpawns query '%s': %s", query.GetQuery(), query.GetError());
 		return false;
@@ -3613,7 +3613,7 @@ bool WorldDatabase::SaveSpawnEntry(Spawn* spawn, const char* spawn_location_name
 		return false;
 	}
 	if(save_zonespawn){
-		query2.RunQuery2(Q_INSERT, "insert into spawn_location_placement (zone_id, instance_id, spawn_location_id, x, y, z, x_offset, y_offset, z_offset, heading, grid_id) values(%u, %u, %u, %f, %f, %f, %f, %f, %f, %f, %u)", spawn->GetZone()->GetZoneID(), spawn->GetZone()->GetInstanceID(), spawn->GetSpawnLocationID(), spawn->GetX(), spawn->GetY(), spawn->GetZ(),x_offset, y_offset, z_offset, spawn->GetHeading(), spawn->appearance.pos.grid_id);
+		query2.RunQuery2(Q_INSERT, "insert into spawn_location_placement (zone_id, instance_id, spawn_location_id, x, y, z, x_offset, y_offset, z_offset, heading, grid_id) values(%u, %u, %u, %f, %f, %f, %f, %f, %f, %f, %u)", spawn->GetZone()->GetZoneID(), spawn->GetZone()->GetInstanceID(), spawn->GetSpawnLocationID(), spawn->GetX(), spawn->GetY(), spawn->GetZ(),x_offset, y_offset, z_offset, spawn->GetHeading(), spawn->GetLocation());
 		if(query2.GetErrorNumber() && query2.GetError() && query2.GetErrorNumber() < 0xFFFFFFFF){
 			LogWrite(SPAWN__ERROR, 0, "Spawn", "Error in SaveSpawnEntry query '%s': %s", query2.GetQuery(), query2.GetError());
 			return false;

+ 3 - 3
EQ2/source/WorldServer/Zone/region_map_v1.cpp

@@ -216,7 +216,7 @@ void RegionMapV1::IdentifyRegionsInGrid(Client *client, const glm::vec3 &locatio
 	else
 		client->SimpleMessage(CHANNEL_COLOR_RED, "No map to establish grid id, using grid id 0 (attempt match all).");
 
-	client->Message(2, "Region check against location %f / %f / %f. Grid to try: %u, player grid is %u, widget id is %u.  Widget location is %f %f %f.", location.x, location.y, location.z, grid, client->GetPlayer()->appearance.pos.grid_id, widget_id, x, y, z);
+	client->Message(2, "Region check against location %f / %f / %f. Grid to try: %u, player grid is %u, widget id is %u.  Widget location is %f %f %f.", location.x, location.y, location.z, grid, client->GetPlayer()->GetLocation(), widget_id, x, y, z);
 	for (itr = Regions.begin(); itr != Regions.end(); itr++)
 	{
 		Region_Node *node = itr->first;
@@ -284,7 +284,7 @@ void RegionMapV1::MapRegionsNearSpawn(Spawn *spawn, Client *client) const
 			continue;
 
 		if(!BSP_Root) {
-			int32 currentGridID = spawn->appearance.pos.grid_id;
+			int32 currentGridID = spawn->GetLocation();
 			bool inRegion = false;
 			if(!(inRegion = spawn->InRegion(node, nullptr)) && currentGridID == node->grid_id && 
 			( node->trigger_widget_id == spawn->trigger_widget_id || (node->dist > 0.0f && spawn->GetDistance(node->x, node->y, node->z) < node->dist)) ) {
@@ -466,7 +466,7 @@ void RegionMapV1::TicRegionsNearSpawn(Spawn *spawn, Client *client) const
 		
 		if(!BSP_Root) {
 			bool passDistCheck = false;
-			int32 currentGridID = spawn->appearance.pos.grid_id;
+			int32 currentGridID = spawn->GetLocation();
 			if(testitr->second.timerTic && currentGridID == node->grid_id && (node->trigger_widget_id == spawn->trigger_widget_id || (node->dist > 0.0f && spawn->GetDistance(node->x, node->y, node->z) <= node->dist && (passDistCheck = true)))
 				&& Timer::GetCurrentTime2() >= (testitr->second.lastTimerTic + testitr->second.timerTic)) {
 					testitr->second.lastTimerTic = Timer::GetCurrentTime2();

+ 1 - 1
EQ2/source/WorldServer/client.cpp

@@ -585,7 +585,7 @@ void Client::HandlePlayerRevive(int32 point_id)
 	origZ = player->GetZ();
 	origHeading = player->GetHeading();
 	ZoneServer* originalZone = GetCurrentZone();
-	int32 origGridID = GetPlayer()->appearance.pos.grid_id;
+	int32 origGridID = GetPlayer()->GetLocation();
 
 	float x, y, z, heading;
 	RevivePoint* revive_point = 0;

+ 2 - 2
EQ2/source/WorldServer/zoneserver.cpp

@@ -2663,7 +2663,7 @@ void ZoneServer::DeterminePosition(SpawnLocation* spawnlocation, Spawn* spawn){
 	spawn->SetSpawnOrigHeading(spawn->GetHeading());
 	spawn->SetSpawnOrigPitch(spawnlocation->pitch);
 	spawn->SetSpawnOrigRoll(spawnlocation->roll);
-	spawn->appearance.pos.grid_id = spawnlocation->grid_id;
+	spawn->SetLocation(spawnlocation->grid_id);
 	spawn->SetSpawnLocationPlacementID(spawnlocation->placement_id);
 }
 
@@ -6069,7 +6069,7 @@ void ZoneServer::CheckLocationGrids() {
 			float x = player->GetX();
 			float y = player->GetY();
 			float z = player->GetZ();
-			int32 grid_id = player->appearance.pos.grid_id;
+			int32 grid_id = player->GetLocation();
 			MutexList<LocationGrid*>::iterator location_grid_itr = location_grids.begin();
 			while (location_grid_itr.Next()) {
 				LocationGrid* grid = location_grid_itr.value;