[Feature] Allow any spawn2 spawned mob to path while zone is idle if new flag is set. (#1339)

* Changes to allow any spawn2 to be marked to path even when zone is idle

* Fixed for Kingly review of PR

Co-authored-by: Noudess <noudess@gmail.com>
This commit is contained in:
Paul Coene
2021-05-10 02:21:43 -04:00
committed by GitHub
parent b335568bf9
commit 2edda6e743
7 changed files with 87 additions and 50 deletions
+13 -2
View File
@@ -1732,6 +1732,7 @@ void lua_add_spawn_point(luabind::adl::object table) {
uint32 variance;
uint32 timeleft = 0;
uint32 grid = 0;
bool path_when_zone_idle = false;
int condition_id = 0;
int condition_min_value = 0;
bool enabled = true;
@@ -1841,6 +1842,14 @@ void lua_add_spawn_point(luabind::adl::object table) {
}
}
cur = table["path_when_zone_idle"];
if(luabind::type(cur) != LUA_TNIL) {
try {
path_when_zone_idle = luabind::object_cast<bool>(cur);
} catch(luabind::cast_failed &) {
}
}
cur = table["condition_id"];
if(luabind::type(cur) != LUA_TNIL) {
try {
@@ -1875,8 +1884,10 @@ void lua_add_spawn_point(luabind::adl::object table) {
lua_remove_spawn_point(spawn2_id);
auto t = new Spawn2(spawn2_id, spawngroup_id, x, y, z, heading, respawn, variance, timeleft, grid,
condition_id, condition_min_value, enabled, static_cast<EmuAppearance>(animation));
auto t = new Spawn2(spawn2_id, spawngroup_id, x, y, z, heading, respawn,
variance, timeleft, grid, path_when_zone_idle, condition_id,
condition_min_value, enabled, static_cast<EmuAppearance>(animation));
zone->spawn2_list.Insert(t);
}
}