Skip to content

Commit f654490

Browse files
Niam5Foereaper
andcommitted
Add SetSpawnedByDefault gameobject method (VMaNGOS)
Co-Authored-By: Foe <[email protected]>
1 parent cc7383d commit f654490

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

methods/VMangos/GameObjectMethods.h

+17-2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,21 @@ namespace LuaGameObject
300300
go->SetRespawnTime(respawn);
301301
return 0;
302302
}
303+
304+
/**
305+
* Sets whether or not the [GameObject] will be spawned by default
306+
*
307+
* Primarily used for temporary spawns.
308+
*
309+
* @param bool spawn = true : if false, it will prevent the [GameObject] from respawning by default
310+
*/
311+
int SetSpawnedByDefault(Eluna* E, GameObject* go)
312+
{
313+
bool spawn = E->CHECKVAL<bool>(2, true);
314+
315+
go->SetSpawnedByDefault(spawn);
316+
return 0;
317+
}
303318

304319
ElunaRegister<GameObject> GameObjectMethods[] =
305320
{
@@ -315,6 +330,7 @@ namespace LuaGameObject
315330
{ "SetGoState", &LuaGameObject::SetGoState },
316331
{ "SetLootState", &LuaGameObject::SetLootState },
317332
{ "SetRespawnTime", &LuaGameObject::SetRespawnTime },
333+
{ "SetSpawnedByDefault", &LuaGameObject::SetSpawnedByDefault },
318334

319335
// Boolean
320336
{ "IsTransport", &LuaGameObject::IsTransport },
@@ -330,8 +346,7 @@ namespace LuaGameObject
330346
{ "SaveToDB", &LuaGameObject::SaveToDB },
331347

332348
// Not implemented methods
333-
{ "IsDestructible", METHOD_REG_NONE }, // Not implemented
334-
{ "SetSpawnedByDefault", METHOD_REG_NONE } // Not implemented
349+
{ "IsDestructible", METHOD_REG_NONE } // Not implemented
335350
};
336351
};
337352
#endif

0 commit comments

Comments
 (0)