Merge branch 'fixes'

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent c0129de5ed
commit af4f4a1de6
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -705,7 +705,7 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const&
grp->clrBotsAreNamedFlag(); grp->clrBotsAreNamedFlag();
addGroupInfo(grp, name, grp->getAlias()); //addGroupInfo(grp, name, grp->getAlias());
{ {

@ -3926,21 +3926,23 @@ void CGrpProfileFaction::checkTargetsAround()
const uint32 playerRadius=assistPlayers||attackPlayers?thisGrpNpc._AggroRange:0; const uint32 playerRadius=assistPlayers||attackPlayers?thisGrpNpc._AggroRange:0;
const uint32 botRadius=assistBots||attackBots?thisGrpNpc._AggroRange:0; const uint32 botRadius=assistBots||attackBots?thisGrpNpc._AggroRange:0;
CCont<CBot >::iterator itBot=_Grp->bots().begin();
uint32 cellValue = 0; for (CCont<CBot>::iterator itBot=_Grp->bots().begin(), itEnd=_Grp->bots().end(); itBot!=itEnd; ++itBot)
CBot* bot = *itBot;
if (bot)
{ {
CSpawnBot* spawnBot = bot->getSpawnObj(); uint32 cellValue = 0;
if (spawnBot) CBot* bot = *itBot;
if (bot)
{ {
CMirrorPropValueRO<uint32> cell( TheDataset, spawnBot->dataSetRow(), DSPropertyCELL ); CSpawnBot* spawnBot = bot->getSpawnObj();
cellValue = cell(); if (spawnBot)
} else {
nlinfo("BOT NOT SPAWN TO GET CELL"); CMirrorPropValueRO<uint32> cell( TheDataset, spawnBot->dataSetRow(), DSPropertyCELL );
cellValue = cell();
Vision.updateBotsAndPlayers(thisGrpNpc.getAIInstance(), centerPos, playerRadius, botRadius, cellValue);
break;
}
}
} }
Vision.updateBotsAndPlayers(thisGrpNpc.getAIInstance(), centerPos, playerRadius, botRadius, cellValue);
} }
// Assist players // Assist players

@ -2777,7 +2777,7 @@ arg0: is the custom table id (a name)
arg1: is the script with syntax : <PROBA_1>:<hex:LOOT_SET_1>,<PROBA_2>:<hex:LOOT_SET_2>,... arg1: is the script with syntax : <PROBA_1>:<hex:LOOT_SET_1>,<PROBA_2>:<hex:LOOT_SET_2>,...
@code @code
()addUserModel("toto", "<PROBA_1>:<hex:LOOT_SET_1>,<PROBA_2>:<hex:LOOT_SET_2>,..."); ()addCustomLoot("toto", "<PROBA_1>:<hex:LOOT_SET_1>,<PROBA_2>:<hex:LOOT_SET_2>,...");
@endcode @endcode
*/ */

@ -194,11 +194,21 @@ IScriptContext* CStateInstance::findContext(NLMISC::TStringId const strId)
nlassert(this->getGroup()); nlassert(this->getGroup());
#endif #endif
std::vector<CGroup*> grps; std::vector<CGroup*> grps;
this->getGroup()->getAIInstance()->findGroup(grps, CStringMapper::unmap(strId)); getGroup()->getAIInstance()->findGroup(grps, CStringMapper::unmap(strId));
if (grps.size() >= 1)
return grps.back()->getPersistentStateInstance(); FOREACH(grpIt, std::vector<CGroup*>, grps) {
else CGroup *grp = *grpIt;
return NULL; if (grp) {
if (!grp->isSpawned())
continue;
CStateInstance *stateInstance = grp->getPersistentStateInstance();
if (stateInstance)
return stateInstance;
}
}
return NULL;
} }
std::string CStateInstance::getContextName() std::string CStateInstance::getContextName()

@ -14273,7 +14273,6 @@ bool CCharacter::autoFillExchangeView()
CMission* currentMission = NULL; CMission* currentMission = NULL;
CGameItemPtr invItem; CGameItemPtr invItem;
uint stepCounter, candidateCounter, totalItemsInBag, itemsSeenCount; uint stepCounter, candidateCounter, totalItemsInBag, itemsSeenCount;
CActiveStepPD activeStep;
CMissionTemplate* missionTemplate; CMissionTemplate* missionTemplate;
std::map<uint32, CActiveStepPD>::iterator stepIterator; std::map<uint32, CActiveStepPD>::iterator stepIterator;
std::vector<IMissionStepTemplate::CSubStep> validateSteps; std::vector<IMissionStepTemplate::CSubStep> validateSteps;
@ -14308,6 +14307,20 @@ bool CCharacter::autoFillExchangeView()
break; break;
validateSteps = missionTemplate->Steps[*itSet - 1]->getSubSteps(); validateSteps = missionTemplate->Steps[*itSet - 1]->getSubSteps();
// get gift step from mission
const CActiveStepPD *botGiftStep = currentMission->getSteps(*itSet);
if (botGiftStep)
{
// fill in remaining quantities
for(uint i = 0; i < validateSteps.size(); ++i)
{
const CActiveStepStatePD *gift = botGiftStep->getStates(i+1);
if (gift != NULL)
validateSteps[i].Quantity = gift->getState();
}
}
// the exchange temp inventory thingy has only 8 slots, so very benign failures to put items into it // the exchange temp inventory thingy has only 8 slots, so very benign failures to put items into it
// are possible. Hence merely breaking (doing no further work) as opposed to aborting work done, // are possible. Hence merely breaking (doing no further work) as opposed to aborting work done,
// and still returning "true". (exchangeWorked == false does not necessarily represent a failure of the whole // and still returning "true". (exchangeWorked == false does not necessarily represent a failure of the whole

Loading…
Cancel
Save