Skip to content

Commit

Permalink
tweak Ban/Water/Ped OOP definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Aug 7, 2016
1 parent 2bde320 commit c6b4202
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Server/mods/deathmatch/logic/luadefs/CLuaBanDefs.cpp
Expand Up @@ -36,16 +36,15 @@ void CLuaBanDefs::LoadFunctions ()

}

// TODO: The "set" attribute of .admin, .reason and .unbanTime needs to be checked for syntax
void CLuaBanDefs::AddClass ( lua_State* luaVM )
{
lua_newclass ( luaVM );

lua_classfunction ( luaVM, "create", "addBan" );
lua_classfunction ( luaVM, "remove", "removeBan" );
lua_classfunction ( luaVM, "getList", "getBans" );
lua_classfunction ( luaVM, "reload", "reloadBans" );

lua_classfunction ( luaVM, "remove", "removeBan" );
lua_classfunction ( luaVM, "getAdmin", "getBanAdmin" );
lua_classfunction ( luaVM, "getIP", "getBanIP" );
lua_classfunction ( luaVM, "getNick", "getBanNick" );
Expand Down
5 changes: 1 addition & 4 deletions Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp
Expand Up @@ -154,12 +154,9 @@ void CLuaPedDefs::AddClass ( lua_State* luaVM )
lua_classvariable ( luaVM, "fightingStyle", "setPedFightingStyle", "getPedFightingStyle" );
lua_classvariable ( luaVM, "gravity", "setPedGravity", "getPedGravity" );
lua_classvariable ( luaVM, "weaponSlot", "setPedWeaponSlot", "getPedWeaponSlot" );
lua_classvariable ( luaVM, "ammoInClipOfCurrentWeaponSlot", NULL, "getPedAmmoInClip" );
lua_classvariable ( luaVM, "weaponInCurrentWeaponSlot", NULL, "getPedWeapon" );
lua_classvariable ( luaVM, "target", NULL, "getPedTarget" );
lua_classvariable ( luaVM, "vehicleSeat", NULL, "getPedOccupiedVehicleSeat" );
lua_classvariable ( luaVM, "contactElement", NULL, "getPedContactElement" );
lua_classvariable ( luaVM, "totalAmmoInWeaponOfCurrentWeaponSlot", NULL, "getPedTotalAmmo" );
lua_classvariable ( luaVM, "vehicle", "warpPedIntoVehicle", "getPedOccupiedVehicle", OOP_WarpPedIntoVehicle, GetPedOccupiedVehicle ); // what about removePedFromVehicle?
lua_classvariable ( luaVM, "dead", "killPed", "isPedDead" ); // Setting this to any value will still kill the ped. Should we special case this?
lua_classvariable ( luaVM, "walkingStyle", "setPedWalkingStyle", "getPedWalkingStyle" );
Expand Down Expand Up @@ -1556,4 +1553,4 @@ int CLuaPedDefs::TakeAllWeapons ( lua_State* luaVM )

lua_pushboolean ( luaVM, false );
return 1;
}
}
11 changes: 4 additions & 7 deletions Server/mods/deathmatch/logic/luadefs/CLuaWaterDefs.cpp
Expand Up @@ -28,22 +28,19 @@ void CLuaWaterDefs::AddClass ( lua_State* luaVM )
lua_newclass ( luaVM );

lua_classfunction ( luaVM, "create", "createWater" );
lua_classfunction ( luaVM, "resetColor", "resetWaterColor" );
lua_classfunction ( luaVM, "resetLevel", "resetWaterLevel" );
lua_classfunction ( luaVM, "getWaveHeight", "getWaveHeight" );
lua_classfunction ( luaVM, "setWaveHeight", "setWaveHeight" );

lua_classfunction ( luaVM, "getVertexPosition", "getWaterVertexPosition" );
lua_classfunction ( luaVM, "getWaveHeight", "getWaveHeight" );
lua_classfunction ( luaVM, "getColor", "getWaterColor" );

lua_classfunction ( luaVM, "setWaveHeight", "setWaveHeight" );
lua_classfunction ( luaVM, "setColor", "setWaterColor" );
lua_classfunction ( luaVM, "setVertexPosition", "setWaterVertexPosition" );
lua_classfunction ( luaVM, "setLevel", "setWaterLevel" );

lua_classfunction ( luaVM, "resetColor", "resetWaterColor" );
lua_classfunction ( luaVM, "resetLevel", "resetWaterLevel" );

lua_classvariable ( luaVM, "level", "setWaterLevel", NULL );
lua_classvariable ( luaVM, "height", "setWaveHeight", "getWaveHeight" );
//lua_classvariable ( luaVM, "color", "setWaterColor", "getWaterColor" );

lua_registerclass ( luaVM, "Water", "Element" );
}
Expand Down

0 comments on commit c6b4202

Please sign in to comment.