File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed
blade-engine/src/com/bladecoder/engine/actions Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -40,37 +40,36 @@ public enum SceneAttr {
40
40
@ ActionProperty
41
41
@ ActionPropertyDescription ("The attribute value" )
42
42
private String value ;
43
-
43
+
44
44
private World w ;
45
-
45
+
46
46
@ Override
47
47
public void init (World w ) {
48
48
this .w = w ;
49
49
}
50
50
51
51
@ Override
52
52
public boolean run (VerbRunner cb ) {
53
- Scene s = (scene != null && !scene .isEmpty ()) ? w .getScene (scene ) : w
54
- .getCurrentScene ();
53
+ Scene s = (scene != null && !scene .isEmpty ()) ? w .getScene (scene ) : w .getCurrentScene ();
55
54
56
55
if (attr == SceneAttr .STATE ) {
57
56
if (!ActionUtils .compareNullStr (value , s .getState ())) {
58
- gotoElse (( VerbRunner ) cb );
57
+ gotoElse (cb );
59
58
}
60
59
} else if (attr == SceneAttr .CURRENT_SCENE ) {
61
60
String scn = w .getCurrentScene ().getId ();
62
-
63
- if (!ActionUtils .compareNullStr (value , scn )) {
64
- gotoElse (( VerbRunner ) cb );
61
+
62
+ if (!ActionUtils .compareNullStr (value , scn ) && ! ActionUtils . compareNullStr ( s . getId (), scn ) ) {
63
+ gotoElse (cb );
65
64
}
66
65
} else if (attr == SceneAttr .PLAYER ) {
67
66
CharacterActor player = s .getPlayer ();
68
-
69
- String id = player != null ? player .getId (): null ;
70
-
67
+
68
+ String id = player != null ? player .getId () : null ;
69
+
71
70
if (!ActionUtils .compareNullStr (value , id )) {
72
- gotoElse (( VerbRunner ) cb );
73
- }
71
+ gotoElse (cb );
72
+ }
74
73
}
75
74
76
75
return false ;
You can’t perform that action at this time.
0 commit comments