From 4ef633c68fd26b8fd9b277a2a44656cae768f9a6 Mon Sep 17 00:00:00 2001 From: Jackz Date: Wed, 6 Jul 2022 19:42:57 -0500 Subject: [PATCH] Use new move points save system --- scripting/include/guesswho/gwcmds.inc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripting/include/guesswho/gwcmds.inc b/scripting/include/guesswho/gwcmds.inc index 986d847..9d8d257 100644 --- a/scripting/include/guesswho/gwcmds.inc +++ b/scripting/include/guesswho/gwcmds.inc @@ -19,13 +19,15 @@ public Action Command_GuessWho(int client, int args) { } else { subcmd = currentSet; } - if(SaveMapData(currentMap, subcmd)) { + if(movePoints.SaveMap(currentMap, subcmd)) { ReplyToCommand(client, "Saved movement data for %s/%s", currentMap, subcmd); } else { ReplyToCommand(client, "Failed to save map data"); } } else if(StrEqual(subcmd, "load")) { - if(LoadMapData(currentMap, currentSet)) { + MovePoints points = MovePoints.LoadMap(currentMap, currentSet); + if(points != null) { + Game.SetPoints(points); ReplyToCommand(client, "Loaded movement data for %s/%s", currentMap, currentSet); } else { ReplyToCommand(client, "Failed to load map data"); @@ -89,9 +91,13 @@ public Action Command_GuessWho(int client, int args) { if(!LoadConfigForMap(currentMap)) { ReplyToCommand(client, "Warn: No config entry for %s", currentMap); } - if(!LoadMapData(currentMap, currentSet)) { - ReplyToCommand(client, "Warn: No map data found for %s/%s", currentMap, currentSet); - } else if(movePoints.Length == 0) { + MovePoints points = MovePoints.LoadMap(currentMap, currentSet); + if(points != null) { + if(movePoints.Length == 0) { + ReplyToCommand(client, "Warn: No map data found for %s/%s", currentMap, currentSet); + } + Game.SetPoints(points); + } else { ReplyToCommand(client, "Warn: %s/%s has 0 saved movement locations", currentMap, currentSet); } Game.Cleanup();