home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let's see if this provides better pseudo-randomness.
[plomrogue]
/
src
/
control.c
diff --git
a/src/control.c
b/src/control.c
index 9915891bd756337b7c954ca3c3282b004d7fb451..a2a44b2aaac710ff3b4305abce9a2800f448f1d4 100644
(file)
--- a/
src/control.c
+++ b/
src/control.c
@@
-15,28
+15,29
@@
* growshrink_active_window()
*/
#include "map_object_actions.h" /* for player_wait(), move_player() */
* growshrink_active_window()
*/
#include "map_object_actions.h" /* for player_wait(), move_player() */
+#include "command_db.h" /* for is_command_id_shortdsc() */
extern void record_control(int action, struct World * world)
{
extern void record_control(int action, struct World * world)
{
- if
(0 == action
)
+ if
(is_command_id_shortdsc(world, action, "wait")
)
{
player_wait(world);
}
{
player_wait(world);
}
- else if (
NORTH == action
)
+ else if (
is_command_id_shortdsc(world, action, "player_u")
)
{
move_player(world, NORTH);
}
{
move_player(world, NORTH);
}
- else if (
EAST == action
)
+ else if (
is_command_id_shortdsc(world, action, "player_r")
)
{
move_player(world, EAST);
}
{
move_player(world, EAST);
}
- else if (
SOUTH == action
)
+ else if (
is_command_id_shortdsc(world, action, "player_d")
)
{
move_player(world, SOUTH);
}
{
move_player(world, SOUTH);
}
- else if (
WEST == action
)
+ else if (
is_command_id_shortdsc(world, action, "player_l")
)
{
move_player(world, WEST);
}
{
move_player(world, WEST);
}