@@ -301,7 +301,22 @@ namespace LuaGameObject
301
301
go->SetRespawnTime (respawn);
302
302
return 0 ;
303
303
}
304
-
304
+
305
+ /* *
306
+ * Sets whether or not the [GameObject] will be spawned by default
307
+ *
308
+ * Primarily used for temporary spawns.
309
+ *
310
+ * @param bool spawn = true : if false, it will prevent the [GameObject] from respawning by default
311
+ */
312
+ int SetSpawnedByDefault (Eluna* E, GameObject* go)
313
+ {
314
+ bool spawn = E->CHECKVAL <bool >(2 , true );
315
+
316
+ go->SetSpawnedByDefault (spawn);
317
+ return 0 ;
318
+ }
319
+
305
320
ElunaRegister<GameObject> GameObjectMethods[] =
306
321
{
307
322
// Getters
@@ -316,6 +331,7 @@ namespace LuaGameObject
316
331
{ " SetGoState" , &LuaGameObject::SetGoState },
317
332
{ " SetLootState" , &LuaGameObject::SetLootState },
318
333
{ " SetRespawnTime" , &LuaGameObject::SetRespawnTime },
334
+ { " SetSpawnedByDefault" , &LuaGameObject::SetSpawnedByDefault },
319
335
320
336
// Boolean
321
337
{ " IsTransport" , &LuaGameObject::IsTransport },
@@ -331,8 +347,7 @@ namespace LuaGameObject
331
347
{ " SaveToDB" , &LuaGameObject::SaveToDB },
332
348
333
349
// Not implemented methods
334
- { " IsDestructible" , METHOD_REG_NONE }, // Not implemented
335
- { " SetSpawnedByDefault" , METHOD_REG_NONE } // Not implemented
350
+ { " IsDestructible" , METHOD_REG_NONE } // Not implemented
336
351
};
337
352
};
338
353
#endif
0 commit comments