ryzomcore
ryzomcore copied to clipboard
Should be able to run through TP gates while mounted
Original report by Jan Boon (Bitbucket: [Jan Boon](https://bitbucket.org/Jan Boon), ).
Should be able to run through TP gates while mounted, makes not much sense why this doesn't happen.
Not optimal, but for poc is fine. Also triggers on room teleporters.
diff --git a/src/gpm_service/world_position_manager.cpp b/src/gpm_service/world_position_manager.cpp
index a1f11302..10fc7859 100644
--- a/src/gpm_service/world_position_manager.cpp
+++ b/src/gpm_service/world_position_manager.cpp
@@ -2270,8 +2270,22 @@ void CWorldPositionManager::movePlayer(CWorldEntity *entity, sint32 x, sint32 y,
// do move
entity->Primitive->move(movVector, wi);
+ uint64 oldUserData = entity->Primitive->UserData;
+ if (entity != master)
+ {
+ // TODO: should be function in CWorldEntity to set primitive userData from master
+ entity->Primitive->UserData = ((uint64)(master->Index.getIndex()) << 16);
+ }
+
// eval collision and get triggers state
entity->MoveContainer->evalNCPrimitiveCollision(1, entity->Primitive, wi);
+
+ if (entity != master)
+ {
+ // TODO: should be function in CWorldEntity to restore entity UserData
+ entity->Primitive->UserData = oldUserData;
+ }
+
//_PatatSubscribeManager.processPacsTriggers(entity->MoveContainer);
processPacsTriggers(entity->MoveContainer);