From 71b300903895042636a6be3670f4f15b4afec9e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nuno=20Gon=C3=A7alves=20=28Ulukyn=29?= Date: Thu, 7 Sep 2023 13:22:16 +0100 Subject: [PATCH] spawnBots accept now name and vpx, addedspawnGroup_ffsssffff_c --- ryzom/server/src/ai_service/ai_grp.h | 3 + ryzom/server/src/ai_service/ai_grp_fauna.cpp | 5 + ryzom/server/src/ai_service/ai_grp_fauna.h | 1 + ryzom/server/src/ai_service/ai_grp_npc.cpp | 65 +++++++++++- ryzom/server/src/ai_service/ai_grp_npc.h | 1 + ryzom/server/src/ai_service/ai_grp_pet.cpp | 12 +-- ryzom/server/src/ai_service/ai_grp_pet.h | 1 + ryzom/server/src/ai_service/ai_instance.cpp | 19 ++-- ryzom/server/src/ai_service/ai_instance.h | 4 +- ryzom/server/src/ai_service/nf_grp.cpp | 10 +- ryzom/server/src/ai_service/nf_grp_npc.cpp | 145 +++++++++++++++++---------- 11 files changed, 188 insertions(+), 78 deletions(-) diff --git a/ryzom/server/src/ai_service/ai_grp.h b/ryzom/server/src/ai_service/ai_grp.h index c2cdfc011..440967206 100644 --- a/ryzom/server/src/ai_service/ai_grp.h +++ b/ryzom/server/src/ai_service/ai_grp.h @@ -64,6 +64,7 @@ public: virtual void spawnBots() = 0; virtual void spawnBots(const std::string &name) = 0; + virtual void spawnBots(const std::string &name, const std::string &vpx) = 0; virtual void despawnBots(bool immediately) = 0; virtual void update() = 0; @@ -215,6 +216,8 @@ public: CAliasTreeOwner* aliasTreeOwner() { return this; } + std::string botName; + std::string botVpx; bool _AutoDestroy; void autoDestroy(bool ad) { _AutoDestroy = ad; } diff --git a/ryzom/server/src/ai_service/ai_grp_fauna.cpp b/ryzom/server/src/ai_service/ai_grp_fauna.cpp index 1a54c8c4c..d3e5f8c8d 100644 --- a/ryzom/server/src/ai_service/ai_grp_fauna.cpp +++ b/ryzom/server/src/ai_service/ai_grp_fauna.cpp @@ -551,6 +551,11 @@ void CSpawnGroupFauna::spawnBots(const std::string &name) } +void CSpawnGroupFauna::spawnBots(const std::string &name, const std::string &vpx) +{ +} + + void CSpawnGroupFauna::despawnBots(bool immediately) { setDespawnImmediately(immediately); diff --git a/ryzom/server/src/ai_service/ai_grp_fauna.h b/ryzom/server/src/ai_service/ai_grp_fauna.h index 086e7ac52..bf84b27d3 100644 --- a/ryzom/server/src/ai_service/ai_grp_fauna.h +++ b/ryzom/server/src/ai_service/ai_grp_fauna.h @@ -72,6 +72,7 @@ public: virtual void spawnBots(); virtual void spawnBots(const std::string &name); + virtual void spawnBots(const std::string &name, const std::string &vpx); virtual void despawnBots(bool immediately); // overrides the init to avoid automatic bot spawn .. diff --git a/ryzom/server/src/ai_service/ai_grp_npc.cpp b/ryzom/server/src/ai_service/ai_grp_npc.cpp index 88e1c22d9..7f6529744 100644 --- a/ryzom/server/src/ai_service/ai_grp_npc.cpp +++ b/ryzom/server/src/ai_service/ai_grp_npc.cpp @@ -392,6 +392,65 @@ void CSpawnGroupNpc::spawnBots(const std::string &name) } } +void CSpawnGroupNpc::spawnBots(const std::string &name, const std::string &vpx) +{ + ucstring ucName; + ucName.fromUtf8(name); + + FOREACH(itBot, CCont, bots()) + { + CBot* bot = *itBot; + if (!bot->isSpawned()) { + bot->spawn(); + + CBotNpc *botnpc = static_cast(bot); + if (botnpc) + { + botnpc->setVisualProperties(vpx); + botnpc->sendVisualProperties(); + } + + if (!ucName.empty()) + { + CSpawnBot *spawnBot = bot->getSpawnObj(); + if (spawnBot) + { + TDataSetRow row = spawnBot->dataSetRow(); + NLNET::CMessage msgout("CHARACTER_NAME"); + msgout.serial(row); + msgout.serial(ucName); + sendMessageViaMirror("IOS", msgout); + spawnBot->getPersistent().setCustomName(ucName); + } + } + + if (_Cell < 0) { + CEntityId id = bot->getSpawnObj()->getEntityId(); + sint32 x = bot->getSpawnObj()->pos().x(); + sint32 y = bot->getSpawnObj()->pos().y(); + sint32 z = bot->getSpawnObj()->pos().h(); + float t = bot->getSpawnObj()->pos().theta().asRadians(); + uint8 cont = 0; + uint8 slide = 1; + NLMISC::TGameCycle tick = CTickEventHandler::getGameCycle() + 1; + CMessage msgout2("ENTITY_TELEPORTATION"); + msgout2.serial( id ); + msgout2.serial( x ); + msgout2.serial( y ); + msgout2.serial( z ); + msgout2.serial( t ); + msgout2.serial( tick ); + msgout2.serial( cont ); + msgout2.serial( _Cell ); + msgout2.serial( slide ); + + sendMessageViaMirror("GPMS", msgout2); + } + } + } +} + + void CSpawnGroupNpc::spawnBots() { FOREACH(itBot, CCont, bots()) @@ -663,13 +722,13 @@ void CGroupNpc::addParameter(std::string const& parameter) static std::string DESPAWN_TIME("despawn time"); static std::string RING("ring"); static std::string DENIED_ASTAR_FLAGS("denied_astar_flags"); - + std::string key, tail; - + // force lowercase std::string p = NLMISC::toLowerAscii(parameter); AI_SHARE::stringToKeywordAndTail(p, key, tail); - + breakable { if (key == RING) diff --git a/ryzom/server/src/ai_service/ai_grp_npc.h b/ryzom/server/src/ai_service/ai_grp_npc.h index 382c6840e..5b520bd27 100644 --- a/ryzom/server/src/ai_service/ai_grp_npc.h +++ b/ryzom/server/src/ai_service/ai_grp_npc.h @@ -46,6 +46,7 @@ public: virtual void spawnBots(); virtual void spawnBots(const std::string &name); + virtual void spawnBots(const std::string &name, const std::string &vpx); virtual void despawnBots(bool immediately); void update(); diff --git a/ryzom/server/src/ai_service/ai_grp_pet.cpp b/ryzom/server/src/ai_service/ai_grp_pet.cpp index 9e45c0d46..7f10d6f86 100644 --- a/ryzom/server/src/ai_service/ai_grp_pet.cpp +++ b/ryzom/server/src/ai_service/ai_grp_pet.cpp @@ -36,15 +36,15 @@ void CSpawnGroupPet::update () if (!botPet->isSpawned() || botPet->haveToDespawn()) // must erase this bot. getPersistent().bots().removeChildByIndex(botPet->getChildIndex()); } - + CEntityId const& entityId = getPersistent().getPetOwner(); CAIEntityPhysical* const petOwner = CAIS::instance().getEntityPhysical(CMirrors::DataSet->getDataSetRow(entityId)); - + // Quick hack to prevent of too much computing.. if (petOwner) - { + { double const distContDestToRealDest = petOwner->wpos().toAIVector().quickDistTo(_PathCont.getDestination()); - + if (distContDestToRealDest>4) // update only each 4 meters. _PathCont.setDestination(petOwner->wpos()); _IsPlayerSpawned = true; @@ -64,11 +64,11 @@ void CSpawnGroupPet::update () _IsPlayerSpawned = false; } } - + { uint32 const newTime = CTimeInterface::gameCycle(); uint32 const dt = newTime - _LastUpdate; - + FOREACH(it, CCont, bots()) { (safe_cast(*it))->update(dt, petOwner); diff --git a/ryzom/server/src/ai_service/ai_grp_pet.h b/ryzom/server/src/ai_service/ai_grp_pet.h index 7d0f56ed2..bf01114c6 100644 --- a/ryzom/server/src/ai_service/ai_grp_pet.h +++ b/ryzom/server/src/ai_service/ai_grp_pet.h @@ -46,6 +46,7 @@ public: void spawnBots() { } void spawnBots(const std::string &name) { } + void spawnBots(const std::string &name, const std::string &vpx) {} void despawnBots (bool immediately) { } void update(); diff --git a/ryzom/server/src/ai_service/ai_instance.cpp b/ryzom/server/src/ai_service/ai_instance.cpp index 8f3fce9fb..6db8caac8 100644 --- a/ryzom/server/src/ai_service/ai_instance.cpp +++ b/ryzom/server/src/ai_service/ai_instance.cpp @@ -675,7 +675,7 @@ static float randomAngle() return val; } -CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &botsName, const std::string &look, sint32 cell) { +CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &grpName, const std::string &look, sint32 cell, const std::string &botsName, const std::string &vpx) { if (!_EventNpcManager) return NULL; @@ -687,7 +687,8 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& } _LastGroupAlias++; - string name = botsName.empty() ? NLMISC::toString("event_group_%u", _LastGroupAlias):botsName; + string name = grpName.empty() ? NLMISC::toString("event_group_%u", _LastGroupAlias):grpName; + string botname = botsName.empty() ? name : botsName; // Create a group CGroupNpc* grp = new CGroupNpc(_EventNpcManager, _LastGroupAlias, name, RYAI_MAP_CRUNCH::Nothing); // Register it in the manager @@ -695,7 +696,8 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& // Set the group parameters grp->setAutoSpawn(false); - + grp->botVpx = vpx; + grp->botName = botname; grp->setName(name); grp->clearParameters(); grp->setPlayerAttackable(true); @@ -705,7 +707,8 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& grp->clrBotsAreNamedFlag(); - eventCreateNpcBot(grp, nbBots, false, sheetId, pos, "", orientation, dispersionRadius, look); + if (nbBots > 0) + eventCreateNpcBot(grp, nbBots, false, sheetId, pos, "", orientation, dispersionRadius, look, botname, vpx); grp->spawn(); CSpawnGroupNpc* spawnGroup = grp->getSpawnObj(); @@ -723,7 +726,7 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& destZone->setPosAndRadius(AITYPES::vp_auto, CAIPos(pos, 0, 0), (uint32)(dispersionRadius*1000.)); spawnGroup->movingProfile().setAIProfile(new CGrpProfileWanderNoPrim(spawnGroup, destZone)); - if (!botsName.empty()) + if (!grpName.empty()) { CStateMachine* sm = _EventNpcManager->getStateMachine(); uint32 stateAlias = grp->getStateAlias("start"); @@ -743,12 +746,12 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& } if (spawnBots) - grp->getSpawnObj()->spawnBots(); + grp->getSpawnObj()->spawnBots(botname, vpx); return grp; } -bool CAIInstance::eventCreateNpcBot(CGroupNpc* grp, uint nbBots, bool spawnBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, const std::string &name, double orientation, double dispersionRadius, const std::string &look) +bool CAIInstance::eventCreateNpcBot(CGroupNpc* grp, uint nbBots, bool spawnBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, const std::string &name, double orientation, double dispersionRadius, const std::string &look, const std::string &botname, const std::string &vpx) { uint32 offset = grp->bots().size(); for (uint i=0; igetSpawnObj()->spawnBots(name); + grp->getSpawnObj()->spawnBots(botname, vpx); return true; } diff --git a/ryzom/server/src/ai_service/ai_instance.h b/ryzom/server/src/ai_service/ai_instance.h index b2a71cd3f..db22a18bf 100644 --- a/ryzom/server/src/ai_service/ai_instance.h +++ b/ryzom/server/src/ai_service/ai_instance.h @@ -208,8 +208,8 @@ public: return NULL; } - CGroupNpc* eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &botsName, const std::string &look, sint32 cell=0); - bool eventCreateNpcBot(CGroupNpc* grp, uint nbBots, bool spawnBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, const std::string &name, double orientation, double dispersionRadius, const std::string &look); + CGroupNpc* eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &grpName, const std::string &look, sint32 cell=0, const std::string &botsName = "", const std::string &vpx = ""); + bool eventCreateNpcBot(CGroupNpc* grp, uint nbBots, bool spawnBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, const std::string &name, double orientation, double dispersionRadius, const std::string &look, const std::string &botsName = "", const std::string &vpx = ""); /// create a new easter egg CBotEasterEgg* createEasterEgg(uint32 easterEggId, NLMISC::CSheetId const& sheetId, std::string const& botName, double x, double y, double z, double heading, const std::string& look); diff --git a/ryzom/server/src/ai_service/nf_grp.cpp b/ryzom/server/src/ai_service/nf_grp.cpp index 43d571157..333c45107 100644 --- a/ryzom/server/src/ai_service/nf_grp.cpp +++ b/ryzom/server/src/ai_service/nf_grp.cpp @@ -65,7 +65,7 @@ void spawn__(CStateInstance* entity, CScriptStack& stack) if (grp) { if (grp->isSpawned()) - grp->getSpawnObj()->spawnBots(); + grp->getSpawnObj()->spawnBots(grp->botName, grp->botVpx); } } @@ -110,10 +110,10 @@ void despawn_f_(CStateInstance* entity, CScriptStack& stack) //---------------------------------------------------------------------------- /** @page code -@subsection spawnBot_fsssffff_ +@subsection spawnBot_fsssfffff_ Spawn new bots in the current group. -Arguments: f(NbrBots), s(Sheet), s(Name), s(Look), f(x), f(y), f(orientation), f(dispersion) -> +Arguments: f(NbrBots), s(Sheet), s(Name), s(Look), f(x), f(y), f(orientation), f(dispersion), f(cell) -> @code @@ -148,12 +148,10 @@ void spawnBot_fsssffff_(CStateInstance* entity, CScriptStack& stack) CGroupNpc* grp = dynamic_cast(entity->getGroup()); if (grp) - aiInstance->eventCreateNpcBot(grp, nbBots, true, sheetId, CAIVector(x, y), name, orientation, dispersionRadius, look); + aiInstance->eventCreateNpcBot(grp, nbBots, true, sheetId, CAIVector(x, y), name, orientation, dispersionRadius, look, grp->botName, grp->botVpx); return; } - - //---------------------------------------------------------------------------- /** @page code diff --git a/ryzom/server/src/ai_service/nf_grp_npc.cpp b/ryzom/server/src/ai_service/nf_grp_npc.cpp index 0a67aea43..66b2c118b 100644 --- a/ryzom/server/src/ai_service/nf_grp_npc.cpp +++ b/ryzom/server/src/ai_service/nf_grp_npc.cpp @@ -2644,6 +2644,7 @@ void rename_s_(CStateInstance* entity, CScriptStack& stack) ucstring name; name.fromUtf8(newName); CGroup* group = entity->getGroup(); + group->botName = newName; if (group->isSpawned()) { @@ -2676,6 +2677,7 @@ void vpx_s_(CStateInstance* entity, CScriptStack& stack) string vpx = (string)stack.top(); stack.pop(); CGroup* group = entity->getGroup(); + group->botVpx = vpx; if (group->isSpawned()) { @@ -3245,45 +3247,71 @@ void resetHealGroups_(CStateInstance* entity, CScriptStack& stack) //---------------------------------------------------------------------------- /** @page code -@subsection spawnGroup_fsssffff_ +@subsection spawnGroup_ffsssffff_ Spawn new group. -Arguments: f(NbrBots), f(spawnBot) s(Sheet), s(Name), s(Look), f(x), f(y), f(orientation), f(dispersion) -> +Arguments: f(NbrBots), f(spawnBot), s(Sheet), s(Name), s(Look), f(x), f(y), f(orientation), f(dispersion) -> @code @endcode */ -// CGroup -void spawnGroup_ffsssffff_c(CStateInstance* entity, CScriptStack& stack) +void spawnGroup_ffsssffff_(CStateInstance* entity, CScriptStack& stack) { - double dispersionRadius = (double)(float)stack.top(); - stack.pop(); + double dispersionRadius = (double)(float)stack.top(); stack.pop(); + double orientation = (double)(float)stack.top(); stack.pop(); + double y = (double)(float)stack.top(); stack.pop(); + double x = (double)(float)stack.top(); stack.pop(); + string look = (string)stack.top(); stack.pop(); + string name = (string)stack.top(); stack.pop(); + CSheetId sheetId((string)stack.top()); stack.pop(); + bool spawn = (float&)stack.top()!=0.0f; stack.pop(); + uint nbBots = (uint)(float)stack.top(); stack.pop(); - double orientation = (double)(float)stack.top(); - stack.pop(); + IManagerParent* const managerParent = entity->getGroup()->getOwner()->getOwner(); + CAIInstance* const aiInstance = dynamic_cast(managerParent); + if (!aiInstance) + return; - double y = (double)(float)stack.top(); - stack.pop(); + CGroupNpc* grp = dynamic_cast(entity->getGroup()); + if (grp) + { + CSpawnGroupNpc* spawnGroup = grp->getSpawnObj(); + CGroupNpc* npcGroup; + if (spawnGroup) + npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look, spawnGroup->getCell()); + else + npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look); + } +} - double x = (double)(float)stack.top(); - stack.pop(); - string look = (string)stack.top(); - stack.pop(); +//---------------------------------------------------------------------------- +/** @page code - string name = (string)stack.top(); - stack.pop(); +@subsection spawnGroup_fsssfffff_c +Spawn new group. - CSheetId sheetId((string)stack.top()); - stack.pop(); +Arguments: f(NbrBots), f(spawnBot) s(Sheet), s(Name), s(Look), f(x), f(y), f(orientation), f(dispersion) -> - bool spawn = (float&)stack.top()!=0.0f; - stack.pop(); +@code - uint nbBots = (uint)(float)stack.top(); - stack.pop(); +@endcode + +*/ +// CGroup +void spawnGroup_ffsssffff_c(CStateInstance* entity, CScriptStack& stack) +{ + double dispersionRadius = (double)(float)stack.top(); stack.pop(); + double orientation = (double)(float)stack.top(); stack.pop(); + double y = (double)(float)stack.top(); stack.pop(); + double x = (double)(float)stack.top(); stack.pop(); + string look = (string)stack.top(); stack.pop(); + string name = (string)stack.top(); stack.pop(); + CSheetId sheetId((string)stack.top()); stack.pop(); + bool spawn = (float&)stack.top()!=0.0f; stack.pop(); + uint nbBots = (uint)(float)stack.top(); stack.pop(); IManagerParent* const managerParent = entity->getGroup()->getOwner()->getOwner(); CAIInstance* const aiInstance = dynamic_cast(managerParent); @@ -3291,47 +3319,52 @@ void spawnGroup_ffsssffff_c(CStateInstance* entity, CScriptStack& stack) return; CGroupNpc* grp = dynamic_cast(entity->getGroup()); + CGroupNpc* npcGroup; if (grp) { CSpawnGroupNpc* spawnGroup = grp->getSpawnObj(); - CGroupNpc* npcGroup; if (spawnGroup) npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look, spawnGroup->getCell()); - else - npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look); - if (npcGroup) - stack.push(npcGroup->getPersistentStateInstance()); } -} -void spawnGroup_ffsssffff_(CStateInstance* entity, CScriptStack& stack) -{ - double dispersionRadius = (double)(float)stack.top(); - stack.pop(); + if (!npcGroup) + npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look); - double orientation = (double)(float)stack.top(); - stack.pop(); + if (npcGroup) + stack.push(npcGroup->getPersistentStateInstance()); - double y = (double)(float)stack.top(); - stack.pop(); + return; - double x = (double)(float)stack.top(); - stack.pop(); +} - string look = (string)stack.top(); - stack.pop(); +//---------------------------------------------------------------------------- +/** @page code - string name = (string)stack.top(); - stack.pop(); +@subsection spawnGroup_ffsssssffff_c +Create a group with bots (not spawned) - CSheetId sheetId((string)stack.top()); - stack.pop(); +Arguments: f(NbrBots), f(spawnBot), s(Sheet), s(Name), s(BotName), s(Look), s(vpx), f(x), f(y), f(orientation), f(dispersion) -> - bool spawn = (float&)stack.top()!=0.0f; - stack.pop(); +@code - uint nbBots = (uint)(float)stack.top(); - stack.pop(); +@endcode + +*/ +// CGroup +void spawnGroup_ffsssssffff_c(CStateInstance* entity, CScriptStack& stack) +{ + sint32 cell = (sint32)(float)stack.top(); stack.pop(); + double dispersionRadius = (double)(float)stack.top(); stack.pop(); + double orientation = (double)(float)stack.top(); stack.pop(); + double y = (double)(float)stack.top(); stack.pop(); + double x = (double)(float)stack.top(); stack.pop(); + string vpx = (string)stack.top(); stack.pop(); + string look = (string)stack.top(); stack.pop(); + string botname = (string)stack.top(); stack.pop(); + string name = (string)stack.top(); stack.pop(); + CSheetId sheetId((string)stack.top()); stack.pop(); + bool spawn = (float&)stack.top()!=0.0f; stack.pop(); + uint nbBots = (uint)(float)stack.top(); stack.pop(); IManagerParent* const managerParent = entity->getGroup()->getOwner()->getOwner(); CAIInstance* const aiInstance = dynamic_cast(managerParent); @@ -3339,17 +3372,22 @@ void spawnGroup_ffsssffff_(CStateInstance* entity, CScriptStack& stack) return; CGroupNpc* grp = dynamic_cast(entity->getGroup()); + CGroupNpc* npcGroup; if (grp) { CSpawnGroupNpc* spawnGroup = grp->getSpawnObj(); - CGroupNpc* npcGroup; if (spawnGroup) - npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look, spawnGroup->getCell()); - else - npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look); + npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look, spawnGroup->getCell(), botname, vpx); } -} + if (!npcGroup) + npcGroup = aiInstance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(x, y), dispersionRadius, spawn, orientation, name, look, 0, botname, vpx); + + if (npcGroup) + stack.push(npcGroup->getPersistentStateInstance()); + + return; +} std::map nfGetNpcGroupNativeFunctions() { @@ -3427,6 +3465,7 @@ std::map nfGetNpcGroupNativeFunctions() REGISTER_NATIVE_FUNC(functions, spawnGroup_ffsssffff_); REGISTER_NATIVE_FUNC(functions, spawnGroup_ffsssffff_c); + REGISTER_NATIVE_FUNC(functions, spawnGroup_ffsssssffff_c); // REGISTER_NATIVE_FUNC(functions, hideMissionStepIcon_b_); // REGISTER_NATIVE_FUNC(functions, hideMissionGiverIcon_b_); -- 2.11.4.GIT