@@ -300,6 +300,21 @@ namespace LuaGameObject
300
300
go->SetRespawnTime (respawn);
301
301
return 0 ;
302
302
}
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
+ }
303
318
304
319
ElunaRegister<GameObject> GameObjectMethods[] =
305
320
{
@@ -315,6 +330,7 @@ namespace LuaGameObject
315
330
{ " SetGoState" , &LuaGameObject::SetGoState },
316
331
{ " SetLootState" , &LuaGameObject::SetLootState },
317
332
{ " SetRespawnTime" , &LuaGameObject::SetRespawnTime },
333
+ { " SetSpawnedByDefault" , &LuaGameObject::SetSpawnedByDefault },
318
334
319
335
// Boolean
320
336
{ " IsTransport" , &LuaGameObject::IsTransport },
@@ -330,8 +346,7 @@ namespace LuaGameObject
330
346
{ " SaveToDB" , &LuaGameObject::SaveToDB },
331
347
332
348
// Not implemented methods
333
- { " IsDestructible" , METHOD_REG_NONE }, // Not implemented
334
- { " SetSpawnedByDefault" , METHOD_REG_NONE } // Not implemented
349
+ { " IsDestructible" , METHOD_REG_NONE } // Not implemented
335
350
};
336
351
};
337
352
#endif
0 commit comments