Skip to content

Commit ac34d7c

Browse files
committed
fix(scripting): OnPlayerTeam
1 parent b18f1be commit ac34d7c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

plugin_files/scripting/includes/swiftly/gameevents.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ void BombExploded(Player *player, unsigned short site) __attribute__((weak));
4141
void BombDropped(Player *player) __attribute__((weak));
4242
void BombPickup(Player *player) __attribute__((weak));
4343

44-
45-
4644
void OnMapLoad(const char *mapName) __attribute__((weak));
4745
void OnMapUnload(const char *mapName) __attribute__((weak));
4846
bool OnClientGameMessage(Player *player, int destination, const char *message) __attribute__((weak));
@@ -422,26 +420,27 @@ extern "C"
422420
void Internal_OnPlayerTeam(int slot, unsigned char team, unsigned char oldteam, bool disconnect, bool silent, bool isbot)
423421
{
424422
if (!OnPlayerTeam)
425-
423+
return;
424+
426425
Player *player = g_playerManager->GetPlayer(slot);
427426
if (player == nullptr)
428427
return;
429-
428+
430429
OnPlayerTeam(player, team, oldteam, disconnect, silent, isbot);
431430
}
432-
431+
433432
void Interval_OnPlayerChangeName(int slot, const char *oldname, const char *newName)
434433
{
435434
if (!OnPlayerChangeName)
436-
return;
437-
435+
return;
436+
438437
Player *player = g_playerManager->GetPlayer(slot);
439438
if (player == nullptr)
440439
return;
441-
440+
442441
OnPlayerChangeName(player, oldname, newName);
443442
}
444-
443+
445444
void Internal_OnPlayerInfo(const char *name, int slot, uint64_t steamid, bool bot)
446445
{
447446
if (!OnPlayerInfo)

0 commit comments

Comments
 (0)