Put in braces in my new function as well as the source function.

The entire file has implied braces...  I'd change them all but fear making a mistake.
This commit is contained in:
Paul Coene 2020-04-06 08:10:15 -04:00 committed by GitHub
parent 561433902e
commit b5575133cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3277,13 +3277,15 @@ void EntityList::Evade(Mob *who)
void EntityList::ClearAggro(Mob* targ) void EntityList::ClearAggro(Mob* targ)
{ {
Client *c = nullptr; Client *c = nullptr;
if (targ->IsClient()) if (targ->IsClient()) {
c = targ->CastToClient(); c = targ->CastToClient();
}
auto it = npc_list.begin(); auto it = npc_list.begin();
while (it != npc_list.end()) { while (it != npc_list.end()) {
if (it->second->CheckAggro(targ)) { if (it->second->CheckAggro(targ)) {
if (c) if (c) {
c->RemoveXTarget(it->second, false); c->RemoveXTarget(it->second, false);
}
it->second->RemoveFromHateList(targ); it->second->RemoveFromHateList(targ);
} }
if (c && it->second->IsOnFeignMemory(c)) { if (c && it->second->IsOnFeignMemory(c)) {
@ -3298,14 +3300,16 @@ void EntityList::ClearAggro(Mob* targ)
void EntityList::ClearWaterAggro(Mob* targ) void EntityList::ClearWaterAggro(Mob* targ)
{ {
Client *c = nullptr; Client *c = nullptr;
if (targ->IsClient()) if (targ->IsClient()) {
c = targ->CastToClient(); c = targ->CastToClient();
}
auto it = npc_list.begin(); auto it = npc_list.begin();
while (it != npc_list.end()) { while (it != npc_list.end()) {
if (it->second->IsUnderwaterOnly()) { if (it->second->IsUnderwaterOnly()) {
if (it->second->CheckAggro(targ)) { if (it->second->CheckAggro(targ)) {
if (c) if (c) {
c->RemoveXTarget(it->second, false); c->RemoveXTarget(it->second, false);
}
it->second->RemoveFromHateList(targ); it->second->RemoveFromHateList(targ);
} }
if (c && it->second->IsOnFeignMemory(c)) { if (c && it->second->IsOnFeignMemory(c)) {