home · contact · privacy
Add (crude) field of view to player's view of map.
[plomrogue] / src / server / map_object_actions.c
index 987f13581eb86d9a51d521e712035b06763ba4ca..978683292af5b76ab902e8cb5f3525b540bd9d1c 100644 (file)
 /* Append "text" to game log, or a "." if "text" is the same as the last one. */
 static void update_log(char * text);
 
-/* If "name" fits "moa"->name, set "moa"->func to "func". */
-//static uint8_t try_func_name(struct MapObjAct * moa,
-//                             char * name, void (* func) (struct MapObj *));
-
 /* One actor "wounds" another actor, decrementing his lifepoints and, if they
  * reach zero in the process, killing it. Generates appropriate log message.
  */
@@ -143,14 +139,12 @@ static uint8_t match_dir(char d, char ** dsc_d, char match, char * dsc_match)
 
 static void playerbonus_move(char d, uint8_t passable)
 {
-    char * dsc_dir = "north";
-    if (   match_dir(d, &dsc_dir, '6', "east")
-        || match_dir(d, &dsc_dir, '2', "south")
-        || match_dir(d, &dsc_dir, '4', "west")
-        || match_dir(d, &dsc_dir, '7', "north-west")
-        || match_dir(d, &dsc_dir, '9', "north-east")
-        || match_dir(d, &dsc_dir, '1', "south-west")
-        || match_dir(d, &dsc_dir, '3', "south-east"))
+    char * dsc_dir = "north-east";
+    if (   match_dir(d, &dsc_dir, 'd', "east")
+        || match_dir(d, &dsc_dir, 'c', "south-east")
+        || match_dir(d, &dsc_dir, 'x', "south-west")
+        || match_dir(d, &dsc_dir, 's', "west")
+        || match_dir(d, &dsc_dir, 'w', "north-west"))
     {
         ;
     }