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();
addGroupInfo(grp, name, grp->getAlias());
//addGroupInfo(grp, name, grp->getAlias());
{

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

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

@ -14273,7 +14273,6 @@ bool CCharacter::autoFillExchangeView()
CMission* currentMission = NULL;
CGameItemPtr invItem;
uint stepCounter, candidateCounter, totalItemsInBag, itemsSeenCount;
CActiveStepPD activeStep;
CMissionTemplate* missionTemplate;
std::map<uint32, CActiveStepPD>::iterator stepIterator;
std::vector<IMissionStepTemplate::CSubStep> validateSteps;
@ -14308,6 +14307,20 @@ bool CCharacter::autoFillExchangeView()
break;
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
// 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

Loading…
Cancel
Save