[Targeting] /tar <bad target> should not untarget existing target (#3383)

* [Targeting] /tar <bad target> should not untarget existing target

* Forgot string Id file.

* removed unneeded this->
This commit is contained in:
Paul Coene 2023-06-12 17:40:09 -04:00 committed by GitHub
parent 548eb65e1d
commit ae53efc52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 20 deletions

View File

@ -14419,11 +14419,6 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
return;
}
if (GetTarget())
{
GetTarget()->IsTargeted(-1);
}
// Locate and cache new target
ClientTarget_Struct* ct = (ClientTarget_Struct*)app->pBuffer;
pClientSideTarget = ct->new_target;
@ -14432,6 +14427,11 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
Mob *nt = entity_list.GetMob(ct->new_target);
if (nt)
{
if (GetTarget())
{
GetTarget()->IsTargeted(-1);
}
SetTarget(nt);
bool inspect_buffs = false;
// rank 1 gives you ability to see NPC buffs in target window (SoD+)
@ -14460,21 +14460,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
}
else
{
SetTarget(nullptr);
SetHoTT(0);
UpdateXTargetType(TargetsTarget, nullptr);
Group *g = GetGroup();
if (g && g->HasRole(this, RoleAssist))
g->SetGroupAssistTarget(0);
if (g && g->HasRole(this, RoleTank))
g->SetGroupTankTarget(0);
if (g && g->HasRole(this, RolePuller))
g->SetGroupPullerTarget(0);
MessageString(Chat::Red, DONT_SEE_TARGET);
return;
}
}

View File

@ -100,6 +100,7 @@
#define DUP_LORE 290 //Duplicate lore items are not allowed.
#define TGB_ON 293 //Target other group buff is *ON*.
#define TGB_OFF 294 //Target other group buff is *OFF*.
#define DONT_SEE_TARGET 303 //I don't see anyone by that name around here...
#define DISARMED_TRAP 305 //You have disarmed the trap.
#define LDON_SENSE_TRAP1 306 //You do not Sense any traps.
#define TRADESKILL_NOCOMBINE 334 //You cannot combine these items in this container type!