File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -33,20 +33,21 @@ def __init__(self, room_id):
33
33
for v in range (0 , 9 ):
34
34
self .event_buffer .append (None )
35
35
npc = Player (name = 'Wise man' )
36
- self .players .append (npc )
36
+ self .npc = npc
37
+ self .players .append (self .npc )
37
38
self .new_room_event (['new_player' , npc .pub ()])
38
39
39
40
def move_pnj (self ):
40
- npc = self .get_player ( 'old' )
41
+ npc = self .npc
41
42
if npc :
42
- pos = [npc [ ' position' ] [0 ], npc [ ' position' ] [1 ]]
43
+ pos = [npc . position [0 ], npc . position [1 ]]
43
44
pos [0 ] += random .randint (- 50 , 50 )
44
45
pos [1 ] += random .randint (- 50 , 50 )
45
46
safe = self .room_map .is_safe_position (pos )
46
47
if safe :
47
- npc [ ' position' ] = pos
48
+ npc . position = pos
48
49
self .new_room_event (['update_player_position' ,
49
- ['old' , npc [ ' position' ] ]])
50
+ [npc . public_key , npc . position ]])
50
51
spawn_later (5 , self .move_pnj )
51
52
52
53
def main (self , request ):
You can’t perform that action at this time.
0 commit comments