Merge pull request #486 from yupi2/teleport-msg

fix it saying you teleported when you might've not
This commit is contained in:
shavit 2017-09-09 14:35:59 +03:00 committed by GitHub
commit b4de551cc4

View File

@ -1410,9 +1410,7 @@ public Action Command_Tele(int client, int args)
return Plugin_Handled;
}
TeleportToCheckpoint(client, index);
Shavit_PrintToChat(client, "%T", "MiscCheckpointsTeleported", client, (index + 1), gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
TeleportToCheckpoint(client, index, false);
return Plugin_Handled;
}
@ -1499,7 +1497,7 @@ public int MenuHandler_Checkpoints(Menu menu, MenuAction action, int param1, int
case 1:
{
TeleportToCheckpoint(param1, current - 1);
TeleportToCheckpoint(param1, current - 1, true);
}
case 2:
@ -1575,7 +1573,7 @@ void SaveCheckpoint(int client, int index)
Shavit_SaveSnapshot(client, gA_CheckpointsSnapshots[client][index]);
}
void TeleportToCheckpoint(int client, int index)
void TeleportToCheckpoint(int client, int index, bool suppressMessage)
{
if(index < 0 || index >= CP_MAX || IsNullVector(gF_Checkpoints[client][index][0]))
{
@ -1610,6 +1608,11 @@ void TeleportToCheckpoint(int client, int index)
{
Shavit_StopTimer(client);
}
if(!suppressMessage)
{
Shavit_PrintToChat(client, "%T", "MiscCheckpointsTeleported", client, (index + 1), gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
}
}
public Action Command_Noclip(int client, int args)