summaryrefslogtreecommitdiff
path: root/src/being/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r--src/being/localplayer.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 8a2f86421..a8caa73fa 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -2796,9 +2796,9 @@ void LocalPlayer::crazyMoveA()
signed char param = mMoveProgram[mCrazyMoveState++];
if (param == '?')
{
- const char cmd[] = {'l', 'r', 'u', 'd'};
+ const char cmd[] = {'l', 'r', 'u', 'd', 'L', 'R', 'U', 'D'};
srand(tick_time);
- param = cmd[rand() % 4];
+ param = cmd[rand() % 8];
}
switch (param)
{
@@ -2814,26 +2814,38 @@ void LocalPlayer::crazyMoveA()
case 'r':
move(1, 0);
break;
+ case 'D':
+ move(1, 1);
+ break;
+ case 'U':
+ move (-1, -1);
+ break;
+ case 'L':
+ move(-1, 1);
+ break;
+ case 'R':
+ move(1, -1);
+ break;
case 'f':
- switch (mDirection)
- {
- case UP : dy = -1; break;
- case DOWN : dy = 1; break;
- case LEFT : dx = -1; break;
- case RIGHT: dx = 1; break;
- default: break;
- }
+ if (mDirection | UP)
+ dy = -1;
+ else if (mDirection | DOWN)
+ dy = 1;
+ if (mDirection | LEFT)
+ dx = -1;
+ else if (mDirection | RIGHT)
+ dx = 1;
move(dx, dy);
break;
case 'b':
- switch (mDirection)
- {
- case UP : dy = 1; break;
- case DOWN : dy = -1; break;
- case LEFT : dx = 1; break;
- case RIGHT: dx = -1; break;
- default: break;
- }
+ if (mDirection | UP)
+ dy = 1;
+ else if (mDirection | DOWN)
+ dy = -1;
+ if (mDirection | LEFT)
+ dx = 1;
+ else if (mDirection | RIGHT)
+ dx = -1;
move(dx, dy);
break;
default: