Trying to figure out the best approach to updating implied targets for those who have (me) targeted.
a) should it be pushed to those who have me targeted IF my target changes?
b) should those targeting me always be scanning for my target on the loop? (lots of function calls to GetImpliedTarget() then?)
c) some mystical, magical C++ thing I am unaware of that will keep this updated once set?
The switch (client.cpp) to handle ME targeting something --
Code: Select all
case OP_UpdateTargetMsg:{
LogWrite(OPCODE__DEBUG, "Opcode", "Opcode %04X (%i): OP_UpdateTargetMsg", opcode, opcode);
int16 index = 0;
memcpy(&index, app->pBuffer, sizeof(int16));
GetPlayer()->SetTarget(GetPlayer()->GetSpawnByIndex(index));
if(GetPlayer()->GetTarget())
GetCurrentZone()->CallSpawnScript(GetPlayer()->GetTarget(), SPAWN_SCRIPT_TARGETED, GetPlayer());
//player->SetTarget((int16*)app->pBuffer);
break;
so option a) would be a signal in this case to update those who have me targeted currently. Wonder of World/Zone already maintains a list of every entity that has >me< targeted? Anyone know?
The other place I see SetTarget() getting called is in "
OP_EntityVerbsVerbMsg" in the same switch. Assuming these are spawns that have some an entity_command set, so not sure if we'd have to track it in here, too?
I'm almost assuming that Implied Target does not work on non-attackable entities (guessing?)
Since Xinux has shown Implied Target does not require a group, we cannot simply scan the group list for members targeting Me. Does this mean we'd have to check every player in a given zone in the zone Loop to see if they have any other PC targeted in order to update this box? Seems a bit much.
Last idea, have it be kinda like a feedback pulse (I love Star Trek)... starting where I target an NPC and the NPC initiates a check on me, and anyone who has Me targeted at that time, thus triggering the update.
Am I over-engineering it?

Please say yes.
SCAT!!!!!!!!!!!!!