Skip to content

Commit ff238c0

Browse files
committed
v1.013 - SM Obstacle - Prevent CP jumps
In ShootMania Obstacle, you can jump to any CP you want. We cancel the quest if any jump is made during a quest.
1 parent ab72911 commit ff238c0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Main.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,23 @@
2929
$startTimeVar = "RaceStartTime";
3030
// Name of the RequireContext condition for the script to run in-game
3131
$RequiredContext = "CTmMlScriptIngame";
32+
// Additional script included for ShootMania, concerning Obstacle to prevent jumps from cp to cp
33+
$scriptSMObstaclePreventJump = "";
3234
if ($ShootManiaCall == true) {
3335
$startTimeVar = "StartTime";
3436
$RequiredContext = "CSmMlScriptIngame";
37+
$scriptSMObstaclePreventJump = '
38+
// Little check SM Obstacle specific to avoid any CP jump during a quest
39+
if (LoadedTitle.TitleId == "obstacle@smokegun") {
40+
declare LocalPlayer <=> InputPlayer;
41+
declare netread Net_UsedJump for LocalPlayer = False;
42+
if (Net_UsedJump) {
43+
if (DebugMode) log("Jump used. Quest cancelled.");
44+
clearPersistentData();
45+
return;
46+
}
47+
}
48+
';
3549
}
3650
// URL used in the few requests done in the script (to get the board, the tokens and register a completed quest)
3751
$urlToRequest = ($_SERVER['HTTPS'] == "on") ? "https://" : "http://";
@@ -489,6 +503,8 @@
489503
return;
490504
}
491505
506+
'.$scriptSMObstaclePreventJump.'
507+
492508
declare Text RemoveToken = "'.htmlentities($Token, ENT_XML1).'";
493509
// We set the right token state as collected (True)
494510
for(i,0,Pe_LocalTokensIds[G_QuestId].count-1)

0 commit comments

Comments
 (0)