mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
We can now use interactive actions to alter decals on walls, so it is possible to simulate taking off an object from the scenery and add it as an item.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=363513&#msg_363513 Requires GameDir >= r2601 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9141 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -864,6 +864,7 @@ static int l_CreateCivilian( lua_State *L );
|
||||
|
||||
static int l_BuildFortification( lua_State *L );
|
||||
static int l_RemoveFortification( lua_State *L );
|
||||
static int l_DestroyAndReplaceDecal( lua_State *L );
|
||||
|
||||
static int l_GetFact( lua_State *L );
|
||||
static int l_SetFact( lua_State *L );
|
||||
@@ -1762,6 +1763,7 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
|
||||
|
||||
lua_register( L, "BuildFortification", l_BuildFortification );
|
||||
lua_register( L, "RemoveFortification", l_RemoveFortification );
|
||||
lua_register( L, "DestroyAndReplaceDecal", l_DestroyAndReplaceDecal );
|
||||
|
||||
lua_register(L, "GetFact", l_GetFact );
|
||||
lua_register(L, "SetFact", l_SetFact );
|
||||
@@ -13126,6 +13128,32 @@ static int l_RemoveFortification( lua_State *L )
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_DestroyAndReplaceDecal( lua_State *L )
|
||||
{
|
||||
if ( lua_gettop( L ) >= 3 )
|
||||
{
|
||||
INT32 sGridNo = lua_tointeger( L, 1 );
|
||||
|
||||
size_t len = 0;
|
||||
const char* str = lua_tolstring( L, 2, &len );
|
||||
|
||||
UINT8 index = lua_tointeger( L, 3 );
|
||||
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
|
||||
RemoveAllStructsOfTypeRange( sGridNo, FIRSTWALLDECAL, FOURTHWALLDECAL );
|
||||
RemoveAllStructsOfTypeRange( sGridNo, FIFTHWALLDECAL, EIGTHWALLDECAL );
|
||||
RemoveAllStructsOfTypeRange( sGridNo, FIRSTDECORATIONS, FOURTHDECORATIONS );
|
||||
|
||||
|
||||
BuildStructFromName( sGridNo, 0, str, index );
|
||||
|
||||
ApplyMapChangesToMapTempFile( FALSE );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_GetFact( lua_State *L )
|
||||
{
|
||||
if ( lua_gettop( L ) )
|
||||
|
||||
Reference in New Issue
Block a user