Skip to content

Commit c5dfb33

Browse files
committed
Introduce isPedWearingJetpack
1 parent e909c10 commit c5dfb33

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void CLuaPedDefs::LoadFunctions(void)
2626
CLuaCFunctions::AddFunction("getPedContactElement", GetPedContactElement);
2727
CLuaCFunctions::AddFunction("isPedInVehicle", IsPedInVehicle);
2828
CLuaCFunctions::AddFunction("doesPedHaveJetPack", DoesPedHaveJetPack);
29+
CLuaCFunctions::AddFunction("isPedWearingJetpack", DoesPedHaveJetPack); // introduced in 1.5.5-9.13176
2930
CLuaCFunctions::AddFunction("isPedOnGround", IsPedOnGround);
3031
CLuaCFunctions::AddFunction("getPedTask", GetPedTask);
3132
CLuaCFunctions::AddFunction("getPedSimplestTask", GetPedSimplestTask);
@@ -104,6 +105,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
104105

105106
lua_classfunction(luaVM, "canBeKnockedOffBike", "canPedBeKnockedOffBike");
106107
lua_classfunction(luaVM, "doesHaveJetPack", "doesPedHaveJetPack");
108+
lua_classfunction(luaVM, "isWearingJetpack", "isPedWearingJetpack"); // introduced in 1.5.5-9.13176
107109
lua_classfunction(luaVM, "getAmmoInClip", "getPedAmmoInClip");
108110
lua_classfunction(luaVM, "getAnalogControlState", "getPedAnalogControlState");
109111
lua_classfunction(luaVM, "getAnimation", "getPedAnimation");
@@ -170,6 +172,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
170172
lua_classvariable(luaVM, "vehicleSeat", NULL, "getPedOccupiedVehicleSeat");
171173
lua_classvariable(luaVM, "canBeKnockedOffBike", "setPedCanBeKnockedOffBike", "canPedBeKnockedOffBike");
172174
lua_classvariable(luaVM, "hasJetPack", NULL, "doesPedHaveJetPack");
175+
lua_classvariable(luaVM, "jetpack", NULL, "isPedWearingJetpack"); // introduced in 1.5.5-9.13176
173176
lua_classvariable(luaVM, "armor", NULL, "getPedArmor");
174177
lua_classvariable(luaVM, "cameraRotation", "setPedCameraRotation", "getPedCameraRotation");
175178
lua_classvariable(luaVM, "contactElement", NULL, "getPedContactElement");

Server/mods/deathmatch/logic/CResourceChecker.Data.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ namespace
166166
{"setElementCallPropagationEnabled", "1.3.5-9.06118"},
167167
{"isElementCallPropagationEnabled", "1.3.5-9.06118"},
168168
{"getResourceState", "1.3.5-9.06194"},
169+
{"isPedWearingJetpack", "1.5.5-9.13176"},
169170
};
170171

171172
SVersionItem serverFunctionInitList[] = {
@@ -242,6 +243,7 @@ namespace
242243
{"isElementCallPropagationEnabled", "1.3.5-9.06118"},
243244
{"resendPlayerACInfo", "1.5.1-9.07633"},
244245
{"dbPrepareString", "1.5.2"},
246+
{"isPedWearingJetpack", "1.5.5-9.13176"},
245247
};
246248

247249
//

Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void CLuaPedDefs::LoadFunctions(void)
3131
CLuaCFunctions::AddFunction("getPedWeapon", GetPedWeapon);
3232
CLuaCFunctions::AddFunction("getPedClothes", GetPedClothes);
3333
CLuaCFunctions::AddFunction("doesPedHaveJetPack", DoesPedHaveJetPack);
34+
CLuaCFunctions::AddFunction("isPedWearingJetpack", DoesPedHaveJetPack); // introduced in 1.5.5-9.13176
3435
CLuaCFunctions::AddFunction("isPedOnGround", IsPedOnGround);
3536
CLuaCFunctions::AddFunction("getPedFightingStyle", GetPedFightingStyle);
3637
CLuaCFunctions::AddFunction("getPedWalkingStyle", GetPedMoveAnim);
@@ -104,20 +105,19 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
104105
lua_classfunction(luaVM, "isInWater", "isPedInWater");
105106
lua_classfunction(luaVM, "isOnGround", "isPedOnGround");
106107
lua_classfunction(luaVM, "isInVehicle", "isPedInVehicle");
107-
108108
lua_classfunction(luaVM, "isOnFire", "isPedOnFire");
109109
lua_classfunction(luaVM, "isChoking", "isPedChoking");
110110
lua_classfunction(luaVM, "isDoingGangDriveby", "isPedDoingGangDriveby");
111111
lua_classfunction(luaVM, "isFrozen", "isPedFrozen");
112112
lua_classfunction(luaVM, "isHeadless", "isPedHeadless");
113+
lua_classfunction(luaVM, "isWearingJetpack", "isPedWearingJetpack"); // introduced in 1.5.5-9.13176
113114

114115
lua_classfunction(luaVM, "getArmor", "getPedArmor");
115116
lua_classfunction(luaVM, "getFightingStyle", "getPedFightingStyle");
116117
lua_classfunction(luaVM, "getGravity", "getPedGravity");
117118
lua_classfunction(luaVM, "getStat", "getPedStat");
118119
lua_classfunction(luaVM, "getWeaponSlot", "getPedWeaponSlot");
119120
lua_classfunction(luaVM, "getWalkingStyle", "getPedWalkingStyle");
120-
121121
lua_classfunction(luaVM, "getAmmoInClip", "getPedAmmoInClip");
122122
lua_classfunction(luaVM, "getOccupiedVehicle", "getPedOccupiedVehicle");
123123
lua_classfunction(luaVM, "getWeapon", "getPedWeapon");
@@ -162,13 +162,10 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
162162
GetPedOccupiedVehicle); // what about removePedFromVehicle?
163163
lua_classvariable(luaVM, "dead", "killPed", "isPedDead"); // Setting this to any value will still kill the ped. Should we special case this?
164164
lua_classvariable(luaVM, "walkingStyle", "setPedWalkingStyle", "getPedWalkingStyle");
165-
lua_classvariable(luaVM, "jetpack", "setPedWearingJetpack", "doesPedHaveJetPack");
165+
lua_classvariable(luaVM, "jetpack", "setPedWearingJetpack", "isPedWearingJetpack"); // introduced in 1.5.5-9.13176
166166
// lua_classvariable ( luaVM, "stats", "setPedStat", "getPedStat", CLuaOOPDefs::SetPedStat, CLuaOOPDefs::GetPedStat ); // table
167167
// lua_classvariable ( luaVM, "controlState", "setPedControlState", "getPedControlState", CLuaOOPDefs::SetPedControlState, CLuaOOPDefs::GetPedControlState
168168
// ); // TODO: .controlState["control"] = value
169-
// This commented code will syntax error, a new method has to be implemented to support this
170-
// lua_classvariable ( luaVM, "jetpack", {"removePedJetPack","givePedJetPack}, "doesPedHaveJetPack", CLuaOOPDefs::SetJetpackActive, "doesPedHaveJetPack" );
171-
// // very specialised!
172169

173170
lua_registerclass(luaVM, "Ped", "Element");
174171
}

0 commit comments

Comments
 (0)