add a controlmap entry

for players, vehicles, and turret datablocks
add a client command to setMovemap(%object.getDatablock().controlMap)
This commit is contained in:
AzaezelX 2025-04-13 14:51:30 -05:00
parent a996c09b04
commit 5b2c0c7703
8 changed files with 32 additions and 3 deletions

View file

@ -158,3 +158,16 @@ function disconnectedCleanup()
moduleExec("onDestroyClientConnection", "Game");
}
function clientCmdsetMoveMap(%movemap)
{
if (!isObject(%movemap)) return;
if(isObject(ServerConnection) && isObject(ServerConnection.curMoveMap))
ServerConnection.curMoveMap.pop();
// clear movement
$mvForwardAction = 0;
$mvBackwardAction = 0;
%movemap.push();
ServerConnection.curMoveMap = %movemap;
}

View file

@ -275,7 +275,9 @@ function GameConnection::onPostSpawn( %this )
if (%this.numModsNeedingLoaded)
callOnObjectList("onPostSpawn", %modulesIdList, %this);
else
%this.listener.onPostSpawnComplete(%this);
%this.listener.onPostSpawnComplete(%this);
if (isObject(%this.player.getDatablock().controlMap))
commandToClient(%this, 'setMoveMap', %this.player.getDatablock().controlMap);
}
function GameConnectionListener::onPostSpawnComplete(%this, %client)