Changed: #1469 CEntityId to TDataSetIndex

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 12 years ago
parent bda94764fa
commit a019880cbd

@ -3577,7 +3577,7 @@ void impulsePlaySoundTrigger(NLMISC::CBitMemStream& impulse)
else
{
NLMISC::CVector pos;
NLMISC::CEntityId eid = SoundPosition.getEntityId();
TDataSetIndex compressedIndex = SoundPosition.getEntityId();

@ -39,7 +39,7 @@ public:
Position = position;
}
TPositionOrEntity(const NLMISC::CEntityId& eid)
TPositionOrEntity(const TDataSetIndex& eid)
{
_isPosition = 0;
EntityId = eid;
@ -82,7 +82,7 @@ public:
Position = position;
}
void setEntityId(const NLMISC::CEntityId& eid)
void setEntityId(const TDataSetIndex& eid)
{
_isPosition = 0;
EntityId = eid;
@ -105,10 +105,10 @@ public:
return Position;
}
NLMISC::CEntityId getEntityId() const
TDataSetIndex getEntityId() const
{
if (!isEntityId())
return NLMISC::CEntityId();
return TDataSetIndex();
return EntityId;
}
@ -129,7 +129,7 @@ public:
private:
char _isPosition;
NLMISC::CVector Position;
NLMISC::CEntityId EntityId;
TDataSetIndex EntityId;
};

@ -16,6 +16,10 @@
//
#include "camera_animation_manager/position_or_entity_type_helper.h"
#include "monitor_service/mirrors.h"
#include "game_share/mirror.h"
#include "game_share/mirrored_data_set.h"
#include "game_share/base_types.h"
const TPositionOrEntity CPositionOrEntityHelper::Invalid = TPositionOrEntity();
@ -26,7 +30,7 @@ TPositionOrEntity CPositionOrEntityHelper::fromString(const std::string& s)
std::vector<std::string> res;
NLMISC::splitString(str, ";", res);
// If we don't have 3 components, it's an entityid
// If we don't have 3 components, it's an entity
if (res.size() != 3)
{
std::vector<TAIAlias> res;
@ -48,8 +52,9 @@ TPositionOrEntity CPositionOrEntityHelper::fromString(const std::string& s)
nlerror("TPositionOrentityHelper : invalid entity id from alias %d", alias);
return TPositionOrEntity();
}
TDataSetIndex compressedId = TheDataset.getDataSetRow(eid).getCompressedIndex();
return TPositionOrEntity(eid);
return TPositionOrEntity(compressedId);
}
else
{

Loading…
Cancel
Save