Commit 9a9205b9 by 李进峰

update place

parent 31f6d74a
......@@ -774,26 +774,26 @@ public class GameEnv implements Serializable{
if(npcInstanceBoolean) {
List<Attr> attrs = npcInstance.getAttrs();
for(int j=0; j<attrs.size(); j++) {
if(names[3].equals(attrs.get(j).getName())) {
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<NpcInstance> 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<NpcInstance> 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment