mirror of
https://github.com/UberGames/RPG-X2.git
synced 2025-01-19 15:11:09 +00:00
*added Getter and Setter for 'wait'
*updated Borg1 to new Setters and made use of the hooks where possible Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
parent
6e8bfa7963
commit
166804ef93
1 changed files with 30 additions and 0 deletions
|
@ -1740,6 +1740,33 @@ static int Entity_SetN00bCount(lua_State *L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int Entity_GetWait(lua_State *L) {
|
||||
lent_t *lent;
|
||||
|
||||
lent = Lua_GetEntity(L, 1);
|
||||
if(!lent || !lent->e) {
|
||||
lua_pushinteger(L, 0);
|
||||
return 1;
|
||||
}
|
||||
lua_pushinteger(L, lent->e->wait);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Entity_SetWait(lua_State *L) {
|
||||
lent_t *lent;
|
||||
int wait;
|
||||
|
||||
lent = Lua_GetEntity(L, 1);
|
||||
if(!lent || !lent->e)
|
||||
return 1;
|
||||
wait = (int)luaL_checknumber(L, 2);
|
||||
|
||||
lent->e->wait = wait;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Entity_GetNeverFree(lua_State *L) {
|
||||
lent_t *lent;
|
||||
|
||||
|
@ -2823,6 +2850,9 @@ static const luaL_Reg Entity_meta[] = {
|
|||
{"GetN00bCount", Entity_GetN00bCount}, // args: none; return: int
|
||||
{"SetN00bCount", Entity_SetN00bCount}, // args: int; return: nothing
|
||||
|
||||
{"GetWait", Entity_GetWait}, // args: none; return: int
|
||||
{"SetWait", Entity_SetWait}, // args: int; return: nothing
|
||||
|
||||
{"GetNeverFree", Entity_GetNeverFree}, // args: none; return: bool
|
||||
{"SetNeverFree", Entity_SetNeverFree}, // args: bool; return: nothing
|
||||
|
||||
|
|
Loading…
Reference in a new issue