From 73256e4f7f2f4b5290beba348ba80030124978ec Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 09:48:28 +0200 Subject: [PATCH] Cleanup some RYZOMID code --- .../common/src/game_share/ryzom_entity_id.h | 17 +++++++++++------ .../player_manager/character.cpp | 8 +------- .../frontend_service/distance_prioritizer.cpp | 2 +- .../server/src/gpm_service/world_entity.cpp | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/code/ryzom/common/src/game_share/ryzom_entity_id.h b/code/ryzom/common/src/game_share/ryzom_entity_id.h index 9fc2682ef..0e96486c7 100644 --- a/code/ryzom/common/src/game_share/ryzom_entity_id.h +++ b/code/ryzom/common/src/game_share/ryzom_entity_id.h @@ -30,12 +30,17 @@ namespace RYZOMID { // warning: respect separation with creature /object, it's used in front-end vision prioritizer // creature part (include player) - player = 0, - npc, //1 - creature, //2 - mount, //3 - pack_animal, //4 - flora, //5 + creature_begin = 0, + player = creature_begin, + bot_ai_begin, + npc = bot_begin, //1 + creature, //2 + mount, //3 + pack_animal, //4 + flora, //5 + bot_ai_end = flora, + creature_end = bot_end, + // objects part object, // 6 building, // 7 diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 5518042ed..33d1777b9 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -16324,13 +16324,7 @@ void CCharacter::sendEmote( const NLMISC::CEntityId& id, MBEHAV::EBehaviour beha } CEntityId targetId = getTarget(); - if ( targetId.getType() != RYZOMID::npc && - targetId.getType() != RYZOMID::player && - targetId.getType() != RYZOMID::creature && - targetId.getType() != RYZOMID::mount && - targetId.getType() != RYZOMID::pack_animal && - targetId.getType() != RYZOMID::flora - ) + if (targetId.getType() > creature_end) targetId = CEntityId::Unknown; TDataSetRow targetRow = TheDataset.getDataSetRow( targetId ); diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index 305adb992..04bf990cd 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -915,7 +915,7 @@ inline void CDistancePrioritizer::serialSlotHeader( CClientHost& client, CEntit timestampDelta = 15; timestampDelta |= 0x10; // 'timestampIsThere bit': first bit is bit 5 (high to low order) } - else if ( seenEntityId.getType() >= RYZOMID::object ) + else if ( seenEntityId.getType() > RYZOMID::creature_end ) { // For non-players/non-bots types (e.g. bags), set the timestamp delta if entity is being spawned to the client //if ( _VisualPropertyTreeRoot->B->B->getSHEETnode()->BranchHasPayload ) // assumes this is done after arbitrateDiscreetProperties() // CHANGED BEN diff --git a/code/ryzom/server/src/gpm_service/world_entity.cpp b/code/ryzom/server/src/gpm_service/world_entity.cpp index d9976a1c4..6debb6284 100644 --- a/code/ryzom/server/src/gpm_service/world_entity.cpp +++ b/code/ryzom/server/src/gpm_service/world_entity.cpp @@ -161,7 +161,7 @@ void CWorldEntity::init( const CEntityId& id, const TDataSetRow &index ) { _Type = Trigger; } - else if ( (id.getType() >= RYZOMID::npc ) || ( id.getType() <= RYZOMID::flora) ) + else if ((id.getType() >= RYZOMID::bot_ai_begin) && (id.getType() <= RYZOMID::bot_ai_end)) { _Type = AI; }