mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-12 02:01:29 -10:00
Link in some scripting limbo support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3179 387891d4-d844-0410-90c0-e4c51a9137d3
This commit is contained in:
1 parent
0b582e91eb
commit
c87db8a371
1 file changed
+24
-1
+24
-1
@@ -1635,7 +1635,7 @@ LUA_VAR(Type, l_Shipclass, "shiptype", "Ship class type")
|
||||
return lua_set_args(L, "o", l_Shiptype.Set(Ship_info[idx].class_type));
|
||||
}
|
||||
|
||||
LUA_FUNC(isInTechroom, l_Shipclass, NULL, "Whether ship has been revealed in the techroom", "Gets whether or not the ship class is available in the techroom")
|
||||
LUA_FUNC(IsInTechroom, l_Shipclass, NULL, "Whether ship has been revealed in the techroom", "Gets whether or not the ship class is available in the techroom")
|
||||
{
|
||||
int idx;
|
||||
if(!lua_get_args(L, "o", l_Shipclass.Get(&idx)))
|
||||
@@ -2869,6 +2869,29 @@ LUA_VAR(HitpointsMax, l_Ship, "Number", "Total hitpoints")
|
||||
return lua_set_args(L, "f", shipp->ship_max_hull_strength);
|
||||
}
|
||||
|
||||
LUA_VAR(IsInLimbo, l_Ship, "Boolean", "Ship's limbo status")
|
||||
{
|
||||
object_h *objh;
|
||||
bool newlimbo = false;
|
||||
if(!lua_get_args(L, "o|b", l_Ship.GetPtr(&objh), &newlimbo))
|
||||
return LUA_RETURN_NIL;
|
||||
|
||||
if(!objh->IsValid())
|
||||
return LUA_RETURN_NIL;
|
||||
|
||||
ship *shipp = &Ships[objh->objp->instance];
|
||||
|
||||
if(LUA_SETTING_VAR)
|
||||
{
|
||||
if(newlimbo)
|
||||
shipp->flags |= SF_LIMBO;
|
||||
else
|
||||
shipp->flags &= ~SF_LIMBO;
|
||||
}
|
||||
|
||||
return lua_set_args(L, "b", (shipp->flags & SF_LIMBO) != 0);
|
||||
}
|
||||
|
||||
LUA_VAR(PrimaryBanks, l_Ship, "weaponbanktype", "Array of primary weapon banks")
|
||||
{
|
||||
object_h *objh;
|
||||
|
||||
Reference in new issue
Block a user