… | |
… | |
121 | * ok - the caller will deal with actual object removal/insertion |
121 | * ok - the caller will deal with actual object removal/insertion |
122 | */ |
122 | */ |
123 | if (op->head) |
123 | if (op->head) |
124 | return 1; |
124 | return 1; |
125 | |
125 | |
|
|
126 | if (m != op->map && op->contr) |
|
|
127 | { |
|
|
128 | if (INVOKE_MAP (LEAVE, op->map, ARG_PLAYER (op->contr))) |
|
|
129 | return 0; |
|
|
130 | |
|
|
131 | op->remove (); |
|
|
132 | |
|
|
133 | if (INVOKE_PLAYER (MAP_CHANGE, op->contr, ARG_MAP (m), ARG_INT (newx), ARG_INT (newy))) |
|
|
134 | return 0; |
|
|
135 | |
|
|
136 | if (INVOKE_MAP (ENTER, m, ARG_PLAYER (op->contr), ARG_INT (newx), ARG_INT (newy))) |
|
|
137 | return 0; |
|
|
138 | } |
|
|
139 | else |
126 | op->remove (); |
140 | op->remove (); |
127 | |
141 | |
128 | /* we already have newx, newy, and m, so lets use them. |
142 | /* we already have newx, newy, and m, so lets use them. |
129 | * In addition, this fixes potential crashes, because multipart object was |
143 | * In addition, this fixes potential crashes, because multipart object was |
130 | * on edge of map, +=x, +=y doesn't make correct coordinates. |
144 | * on edge of map, +=x, +=y doesn't make correct coordinates. |
131 | */ |
145 | */ |