… | |
… | |
35 | } |
35 | } |
36 | } else { |
36 | } else { |
37 | $who->message ("follow mode off"); |
37 | $who->message ("follow mode off"); |
38 | delete $follow{$name}; |
38 | delete $follow{$name}; |
39 | } |
39 | } |
|
|
40 | 1 |
40 | }; |
41 | }; |
41 | |
42 | |
42 | sub teleport { |
43 | sub teleport { |
43 | my ($pl, $map, $x, $y) = @_; |
44 | my ($pl, $map, $x, $y) = @_; |
44 | |
45 | |
… | |
… | |
75 | } |
76 | } |
76 | |
77 | |
77 | sub on_clock { |
78 | sub on_clock { |
78 | my ($event) = @_; |
79 | my ($event) = @_; |
79 | |
80 | |
80 | return unless %follow; |
81 | return 0 unless %follow; |
81 | |
82 | |
82 | while (my ($name, $v) = each %follow) { |
83 | while (my ($name, $v) = each %follow) { |
83 | my ($target, $his, $mine) = @$v; |
84 | my ($target, $his, $mine) = @$v; |
84 | my ($who, $other) = (cf::player::find $name, cf::player::find $target); |
85 | my ($who, $other) = (cf::player::find $name, cf::player::find $target); |
85 | |
86 | |
… | |
… | |
104 | } else { |
105 | } else { |
105 | delete $follow{$name}; |
106 | delete $follow{$name}; |
106 | $who->ob->message ("$target is gone..."); |
107 | $who->ob->message ("$target is gone..."); |
107 | } |
108 | } |
108 | } |
109 | } |
|
|
110 | |
|
|
111 | 0 |
109 | } |
112 | } |
110 | |
113 | |
111 | |
114 | |
112 | |
115 | |
113 | |
116 | |