diff options
Diffstat (limited to 'src/game.cpp')
| -rw-r--r-- | src/game.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index 80cc593..bf30cfe 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -83,7 +83,7 @@ void SerializeCamera(std::ofstream &stream, const PkeCamera &cam) { void SerializeInstance(std::ofstream &stream, const CompInstance &comp) { char handleStr[19] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; - snprintf(handleStr, 19, "0x%016lX",static_cast<EntityHandle_T>(comp.entHandle)); + snprintf(handleStr, 19, "0x%016lX", comp.entHandle.hash); EntityType *et = nullptr; for (long i = 0; i < GlobalEntityTypes.Count(); ++i) { if (GlobalEntityTypes[i].grBindsHandle == comp.grBindsHandle) { @@ -249,15 +249,13 @@ void ParseInstance(std::ifstream &stream) { auto *broadphaseProxy = compInst.bt.rigidBody->getBroadphaseProxy(); broadphaseProxy->m_collisionFilterGroup = static_cast<PhysicsCollision_T>(comp.physicsLayer); broadphaseProxy->m_collisionFilterMask = static_cast<PhysicsCollision_T>(comp.physicsMask); - compInst.bt.rigidBody->setUserPointer(reinterpret_cast<void *>(compInst.entHandle)); + compInst.bt.rigidBody->setUserPointer(reinterpret_cast<void *>(compInst.entHandle.hash)); break; } if (strstr(readLine, PKE_FILE_INSTANCE_ENTITY_HANDLE)) { uint64_t prefixLen = strlen(PKE_FILE_INSTANCE_ENTITY_HANDLE); - EntityHandle_T handle_t; - STR2NUM_ERROR result = str2num(handle_t, readLine + prefixLen); + STR2NUM_ERROR result = str2num(comp.entHandle.hash, readLine + prefixLen); assert(result == STR2NUM_ERROR::SUCCESS); - comp.entHandle = EntityHandle{handle_t}; continue; } if (strstr(readLine, PKE_FILE_INSTANCE_ENTITY_TYPE_CODE)) { |
