From beff59564461643b4815f9e45adbec1552751a47 Mon Sep 17 00:00:00 2001 From: hxw Date: Tue, 2 Apr 2019 09:47:09 +0800 Subject: [PATCH] 修复查询某地点有什么东西 --- src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java b/src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java index e73df9e..82fac71 100644 --- a/src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java +++ b/src/main/java/com/qiwu/chatbotbackend/processing/WorldController.java @@ -163,11 +163,11 @@ public class WorldController { } NPCName = currentInfoPoint.get(valuePair[1]).split(":", 2)[1]; - returnStr = gameEnv.queryGoodsIntroByGoodsName(NPCName); + returnStr = gameEnv.queryNpcIntroByNpcName(NPCName); if(returnStr == null ) returnStr = DONT_FOUND; else{ - returnStr = format.replace(ITEM_NAME_SLOT, NPCName).replace(ATTR_VALUE_SLOT, returnStr); + returnStr = format.replace(NPC_NAME_SLOT, NPCName).replace(ATTR_VALUE_SLOT, returnStr); } break; @@ -449,9 +449,9 @@ public class WorldController { format = SCRIPT_ITEM_IN_PLACE; } - destination = currentInfoPoint.get(valuePair[1]).split(":")[1]; + destination = currentInfoPoint.get(valuePair[1]).split(":")[0]; - sites = gameEnv.queryAroundGoodsBySite(historyInfoPoint.get(destination)); + sites = gameEnv.queryAroundGoodsBySite(destination); if(sites == null || sites.size() == 0) returnStr = NOTHING_FOUND; else { @@ -465,14 +465,14 @@ public class WorldController { } } break; - case "queryNPCInPlace": + case "queryNpcInPlace": format = userInfo.varInitialMap.get("NPC_IN_PLACE"); if(format == null){ format = SCRIPT_NPC_IN_PLACE; } - destination = currentInfoPoint.get(valuePair[1]).split(":")[1]; - sites = gameEnv.queryAroundNpcBySite(historyInfoPoint.get(destination)); + destination = currentInfoPoint.get(valuePair[1]).split(":")[0]; + sites = gameEnv.queryAroundNpcBySite(destination); if(sites == null || sites.size() == 0) returnStr = NOTHING_FOUND; else { @@ -495,7 +495,7 @@ public class WorldController { destination = currentInfoPoint.get(valuePair[1]).split(":")[1]; - sites = gameEnv.queryAroundAllBySite(historyInfoPoint.get(destination)); + sites = gameEnv.queryAroundAllBySite(destination); if(sites == null || sites.size() == 0) returnStr = NOTHING_FOUND; else { @@ -510,6 +510,10 @@ public class WorldController { } break; + default: + returnStr = "error"; + break; + } } -- libgit2 0.27.1