ryzomcore icon indicating copy to clipboard operation
ryzomcore copied to clipboard

Should be able to run through TP gates while mounted

Open ryzom-pipeline opened this issue 11 years ago • 1 comments

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.

ryzom-pipeline avatar Feb 15 '14 23:02 ryzom-pipeline

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);
 

nimetu avatar Jun 10 '20 12:06 nimetu