File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
game-engine/world/actor/player Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,7 @@ export class DialogueAction {
140140 this . p . interfaceState . openWidget ( widgetId , {
141141 slot : 'chatbox'
142142 } )
143-
144- const sub = this . p . dialogueInteractionEvent . subscribe ( action => {
143+ const sub = this . p . interfaceState . closed . subscribe ( action => {
145144 sub . unsubscribe ( ) ;
146145 this . _action = action ;
147146 resolve ( this ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const validate: (level: number) => boolean = (level) => {
1111
1212export const action : objectInteractionActionHandler = ( details ) => {
1313 const { player, option } = details ;
14-
1514 if ( option === 'climb' ) {
1615 dialogueAction ( player )
1716 . then ( async d => d . options (
@@ -22,20 +21,18 @@ export const action: objectInteractionActionHandler = (details) => {
2221 ] ) )
2322 . then ( d => {
2423 d . close ( ) ;
25- switch ( d . action ) {
24+ switch ( d . _action . data ) {
2625 case 1 :
2726 case 2 :
28- action ( { ...details , option : `climb-${ ( d . action === 1 ? 'up' : 'down' ) } ` } ) ;
27+ action ( { ...details , option : `climb-${ ( d . _action . data === 1 ? 'up' : 'down' ) } ` } ) ;
2928 return ;
3029 }
3130 } ) ;
3231 return ;
3332 }
34-
3533 const up = option === 'climb-up' ;
3634 const { position } = player ;
3735 const level = position . level + ( up ? 1 : - 1 ) ;
38-
3936 if ( ! validate ( level ) ) return ;
4037 if ( ! details . objectConfig . name . startsWith ( 'Stair' ) ) {
4138 player . playAnimation ( up ? 828 : 827 ) ;
You can’t perform that action at this time.
0 commit comments