add kzcheckpoints_ladders style setting

This commit is contained in:
rtldg 2021-11-04 16:46:16 +00:00
parent 361826908e
commit 48d8e01769
3 changed files with 8 additions and 2 deletions

View File

@ -50,6 +50,7 @@
"block_pright" "0" // Block +right. 2 to stop timer.
"block_pstrafe" "0" // Prevent button inconsistencies (including +pstrafe). May have false positives when players lag. Will prevent some strafe hacks too. Set this to 2 to also stop the timer.
"kzcheckpoints" "0" // KZ styled checkpoints. They reset upon timer start and you don't get reverted to a save state, and you cannot save when airborne or someone else's checkpoints.
"kzcheckpoints_ladders" "0" // KZ styled checkpoints allowed to checkpoint onto ladders (like GOKZ)
// Feature excluding
"unranked" "0" // Unranked style. No ranking points and no records.

View File

@ -190,6 +190,7 @@ public SMCResult OnStyleEnterSection(SMCParser smc, const char[] name, bool opt_
SetStyleSettingInt(gI_CurrentParserIndex, "inaccessible", 0);
SetStyleSettingInt(gI_CurrentParserIndex, "enabled", 1);
SetStyleSettingInt(gI_CurrentParserIndex, "kzcheckpoints", 0);
SetStyleSettingInt(gI_CurrentParserIndex, "kzcheckpoints_ladders", 0);
SetStyleSettingInt(gI_CurrentParserIndex, "force_groundkeys", 0);
gI_OrderedStyles[gI_CurrentParserIndex] = gI_CurrentParserIndex;

View File

@ -1178,17 +1178,21 @@ bool SaveCheckpoint(int client)
if(Shavit_GetStyleSettingInt(gI_Style[client], "kzcheckpoints"))
{
if((GetEntityFlags(client) & FL_ONGROUND) == 0 || client != target)
if (client != target)
{
Shavit_PrintToChat(client, "%T", "CommandSaveCPKZInvalid", client);
return false;
}
if (!(GetEntityFlags(target) & FL_ONGROUND) && (!Shavit_GetStyleSettingBool(gI_Style[client], "kzcheckpoints_ladders") || GetEntityMoveType(client) != MOVETYPE_LADDER))
{
Shavit_PrintToChat(client, "%T", "CommandSaveCPKZInvalid", client);
return false;
}
if(Shavit_InsideZone(client, Zone_Start, -1))
{
Shavit_PrintToChat(client, "%T", "CommandSaveCPKZZone", client);
return false;
}
}