Permalink
Browse files

Fixed a bug where your maptp was not set to off after being temped wh…

…ich could be abusable.
  • Loading branch information...
xhoogland committed Feb 6, 2017
1 parent 8b5f397 commit ff9d5621b3f6eb5d81f4693b649249247d56f3cc
@@ -1025,6 +1025,7 @@ GodHelp:
tempLevel[subjectId] = 0;
UserTemped[subjectId] = "";
+ PlayerSettings(subjectId)->setMapTeleportationEnabled(false);
ColorManager->restorePreviousPlayerCustomColor(subjectId);
@@ -98,6 +98,17 @@ class PlayerSettings <playerId (MAX_PLAYERS)> {
this->toggleSetting(AccountUpdatedForSettingsSettingKey, true);
}
+ /**
+ * Restores any settings which were altered at giving tempadmin. Each setting will default to
+ * what they should be for a normal player. It will automatically be invoked when a player
+ * disconnects from Las Venturas Playground.
+ */
+ @list(OnPlayerDisconnect)
+ public restoreOnDisconnect() {
+ if (LegacyIsUserTempAdmin(playerId))
+ this->toggleSetting(MapTeleportationEnabledSettingKey, false);
+ }
+
// ---------------------------------------------------------------------------------------------
/**
@@ -38,6 +38,10 @@ bool: LegacyIsPlayerIgnored(playerId, subjectId) {
return !!g_Ignore[playerId][subjectId];
}
+bool: LegacyIsUserTempAdmin(playerId) {
+ return tempLevel[playerId] > 0;
+}
+
RemovePlayerFromAnyGame(playerId) {
if (Player(playerId)->isConnected() == false)
return 0;
@@ -101,6 +101,8 @@ RunDeprecatedIrcCommand(line[]) {
Player(pid)->setIsVip(wasVip);
Player(pid)->setLevel(PlayerLevel);
+ PlayerSettings(pid)->setMapTeleportationEnabled(false);
+
ColorManager->restorePreviousPlayerCustomColor(pid);
tempLevel[pid] = 0;

1 comment on commit ff9d562

@xhoogland

This comment has been minimized.

Show comment
Hide comment
@xhoogland

xhoogland Feb 6, 2017

Contributor

Fixes #449.

Contributor

xhoogland commented on ff9d562 Feb 6, 2017

Fixes #449.

Please sign in to comment.