Merge branch 'ark'

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

@ -222,7 +222,7 @@ void CMissionBaseBehaviour::addCompassTarget( uint32 targetId, bool isBot, bool
{ {
if (isBot) if (isBot)
{ {
const CEntityId & id = CAIAliasTranslator::getInstance()->getEntityId( targetId ); const CEntityId & id = CAIAliasTranslator::getInstance()->getEntityId( targetId );
if (id != CEntityId::Unknown) if (id != CEntityId::Unknown)
{ {
@ -294,44 +294,48 @@ void CMissionBaseBehaviour::addCompassTarget( uint32 targetId, bool isBot, bool
} }
} }
nlassert(_Mission->getCompass(freeIdx) == NULL); if (freeIdx < 8)
EGSPD::CMissionCompassPD * compass = _Mission->addToCompass(freeIdx);
nlassert(compass != NULL);
if (c != NULL)
{
compass->setBotId(c->getAlias());
compass->setPlace(CAIAliasTranslator::Invalid);
}
else if (place != NULL)
{ {
compass->setBotId(CAIAliasTranslator::Invalid); if (_Mission->getCompass(freeIdx) == NULL)
compass->setPlace(place->getAlias());
}
else
{
if (isPosition)
{ {
compass->setBotId(targetId); EGSPD::CMissionCompassPD * compass = _Mission->addToCompass(freeIdx);
compass->setPlace(CAIAliasTranslator::Invalid);
if (compass)
sint32 x; {
sint32 y; if (c != NULL)
string textName; {
compass->setBotId(c->getAlias());
CCharacter * user = getMainEntity(); compass->setPlace(CAIAliasTranslator::Invalid);
user->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName); }
else if (place != NULL)
{
compass->setBotId(CAIAliasTranslator::Invalid);
compass->setPlace(place->getAlias());
}
else
{
if (isPosition)
{
compass->setBotId(targetId);
compass->setPlace(CAIAliasTranslator::Invalid);
if (targetId != 0) { sint32 x;
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setX(user->_PropertyDatabase, x*1000); sint32 y;
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setY(user->_PropertyDatabase, y*1000); string textName;
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setTITLE(user->_PropertyDatabase, targetId);
CCharacter * user = getMainEntity();
user->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName);
if (targetId != 0) {
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setX(user->_PropertyDatabase, x*1000);
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setY(user->_PropertyDatabase, y*1000);
CBankAccessor_PLR::getMISSIONS().getArray(_ClientIndex).getTARGET(freeIdx).setTITLE(user->_PropertyDatabase, targetId);
}
targetId = CAIAliasTranslator::Invalid;
}
}
} }
targetId = CAIAliasTranslator::Invalid;
}
else
{
nlstop;
} }
} }
@ -344,7 +348,7 @@ void CMissionBaseBehaviour::addCompassTarget( uint32 targetId, bool isBot, bool
sint32 y = 0; sint32 y = 0;
uint32 txt = 0; uint32 txt = 0;
string msg; string msg;
if ( c ) if ( c )
{ {
x = c->getState().X(); x = c->getState().X();
@ -372,12 +376,12 @@ void CMissionBaseBehaviour::addCompassTarget( uint32 targetId, bool isBot, bool
user->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName); user->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName);
txt = targetId; txt = targetId;
} }
for ( uint i = 0; i < entities.size(); i++) for ( uint i = 0; i < entities.size(); i++)
{ {
if (!isPosition) if (!isPosition)
txt = STRING_MANAGER::sendStringToClient( entities[i],msg,params ); txt = STRING_MANAGER::sendStringToClient( entities[i],msg,params );
PlayerManager.sendImpulseToClient( getEntityIdFromRow(entities[i]), "JOURNAL:ADD_COMPASS", x,y,txt ); PlayerManager.sendImpulseToClient( getEntityIdFromRow(entities[i]), "JOURNAL:ADD_COMPASS", x,y,txt );
} }
} }
@ -1486,18 +1490,18 @@ uint CMissionBaseBehaviour::_updateCompass(CCharacter & user, DBType &missionDb)
compassIdx++; compassIdx++;
} }
} }
CMissionTemplate * tpl = CMissionManager::getInstance()->getTemplate( _Mission->getTemplateId() ); CMissionTemplate * tpl = CMissionManager::getInstance()->getTemplate( _Mission->getTemplateId() );
sint32 x; sint32 x;
sint32 y; sint32 y;
string txtName; string txtName;
user.getPositionCheck(toUpper(tpl->getMissionName()), x, y, txtName); user.getPositionCheck(toUpper(tpl->getMissionName()), x, y, txtName);
if (!txtName.empty()) if (!txtName.empty())
compassIdx++; compassIdx++;
return compassIdx; return compassIdx;
} }

Loading…
Cancel
Save