Make sure getdir return values are in range
u.dx and u.dy should be [-1, +1]
This commit is contained in:
@@ -4488,8 +4488,8 @@ getdir(const char *s)
|
|||||||
mod = 0; /* neither CLICK_1 nor CLICK_2 */
|
mod = 0; /* neither CLICK_1 nor CLICK_2 */
|
||||||
} else {
|
} else {
|
||||||
/* caller expects simulated click to be relative to hero's spot */
|
/* caller expects simulated click to be relative to hero's spot */
|
||||||
u.dx = cc.x - u.ux;
|
u.dx = sgn(cc.x - u.ux);
|
||||||
u.dy = cc.y - u.uy;
|
u.dy = sgn(cc.y - u.uy);
|
||||||
u.dz = 0;
|
u.dz = 0;
|
||||||
|
|
||||||
switch (pos + NHKF_GETPOS_PICK) {
|
switch (pos + NHKF_GETPOS_PICK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user