From 9a9205b9c5469d87ccd66080c6a946c7e1836018 Mon Sep 17 00:00:00 2001 From: 李进峰 Date: Sat, 15 Dec 2018 19:21:30 +0800 Subject: [PATCH] update place --- src/GameEnvironment/GameEnv.java | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/GameEnvironment/GameEnv.java b/src/GameEnvironment/GameEnv.java index b25caee..c8abcc8 100644 --- a/src/GameEnvironment/GameEnv.java +++ b/src/GameEnvironment/GameEnv.java @@ -774,26 +774,26 @@ public class GameEnv implements Serializable{ if(npcInstanceBoolean) { List attrs = npcInstance.getAttrs(); for(int j=0; j npcInstances = placeOrigin.getNpcInstances(); - npcInstances.remove(npcInstance); - Place place= this.placeIndex.get(value); - npcInstance.setPlace(place); - npcInstances = place.getNpcInstances(); - npcInstances.add(npcInstance); - return true; + if(names[3].equals("跟随玩家")) { + if(value.equals("是")) { + this.followNpcIndex.put(npcInstance.getName(), npcInstance); + }else if(value.equals("否")) { + this.followNpcIndex.remove(npcInstance.getName()); }else { + continue; + } + return true; + }else if(names[3].equals("所在地点")) { + Place placeOrigin = npcInstance.getPlace(); + List npcInstances = placeOrigin.getNpcInstances(); + npcInstances.remove(npcInstance); + Place place= this.placeIndex.get(value); + npcInstance.setPlace(place); + npcInstances = place.getNpcInstances(); + npcInstances.add(npcInstance); + return true; + }else { + if(names[3].equals(attrs.get(j).getName())) { attrs.get(j).setValue(value); return true; } -- libgit2 0.27.1