[DiscordArchive] hey Locus, looking at your fixes, if statements, if they don't have them, need the code encapsulated
[DiscordArchive] hey Locus, looking at your fixes, if statements, if they don't have them, need the code encapsulated
Archived author: Deleted User • Posted: 2020-08-14T19:03:31.196000+00:00
Original source
hey Locus, looking at your fixes, if statements, if they don't have them, need the code encapsulated in curly brackets?
Archived author: Deleted User • Posted: 2020-08-14T19:06:27.276000+00:00
Original source
like I'm looking in mod-individual-xp and see this iff block:
``` Player* me = handler->GetSession()->GetPlayer();
if (!me)
return false;
me->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
me->GetSession()->SendAreaTriggerMessage("You have enabled your XP gain.");
return true;
}
```
Archived author: Deleted User • Posted: 2020-08-14T19:06:37.646000+00:00
Original source
that doesn't look correct
Archived author: Deleted User • Posted: 2020-08-14T19:06:54.867000+00:00
Original source
or am I wrong?
Archived author: Deleted User • Posted: 2020-08-14T19:13:34.247000+00:00
Original source
as I go through code I see tons of if, else, and else if statements without brackets
Archived author: Deleted User • Posted: 2020-08-14T19:15:06.949000+00:00
Original source
Sorry for the ping, <@!381683315909984257> just wanted to see if I was right so I could fix some and issue some pull requests
Archived author: locus313 • Posted: 2020-08-14T19:17:54.502000+00:00
Original source
from the feedback i got from helias yeah it should.
Archived author: Deleted User • Posted: 2020-08-14T19:18:12.768000+00:00
Original source
``` for (SessionMap::iterator itr = sessions.begin(); itr != sessions.end(); ++itr)
{
if (!itr->second)
continue;
if (!itr->second->GetPlayer())
{
continue;
}
if(!itr->second->GetPlayer()->IsInWorld())
{
continue;
}
```
Archived author: Deleted User • Posted: 2020-08-14T19:18:20.798000+00:00
Original source
so I see this, that first if statement isn't contained