#include <string.h> /* for strlen(), strcmp() */
#include "yx_uint16.h" /* for yx_uint16 struct, mv_yx_in_dir(),
* yx_uint16_cmp()
#include <string.h> /* for strlen(), strcmp() */
#include "yx_uint16.h" /* for yx_uint16 struct, mv_yx_in_dir(),
* yx_uint16_cmp()
static void actor_hits_actor(struct MapObj * hitter, struct MapObj * hitted);
/* Bonus stuff to actor_*() to happen if actor==player. Mostly writing of log
static void actor_hits_actor(struct MapObj * hitter, struct MapObj * hitted);
/* Bonus stuff to actor_*() to happen if actor==player. Mostly writing of log
*/
static void playerbonus_wait();
static void playerbonus_move(char d, uint8_t passable);
*/
static void playerbonus_wait();
static void playerbonus_move(char d, uint8_t passable);
- else
- {
- update_log("\nYou drop an object.");
- if (0 < world.inventory_select)
- {
- world.inventory_select--;
- }
- }
+ update_log("\nYou drop an object.");
+ world.inventory_sel = world.inventory_sel - (0 < world.inventory_sel);
- else
- {
- update_log("\nYou consume MAGIC MEAT.");
- if (0 < world.inventory_select)
- {
- world.inventory_select--;
- }
- }
+ update_log("\nYou consume MAGIC MEAT.");
+ world.inventory_sel = world.inventory_sel - (0 < world.inventory_sel);
char * path = "config/map_object_actions";
FILE * file = try_fopen(path, "r", f_name);
uint16_t linemax = textfile_sizes(file, NULL);
char line[linemax + 1];
char * path = "config/map_object_actions";
FILE * file = try_fopen(path, "r", f_name);
uint16_t linemax = textfile_sizes(file, NULL);
char line[linemax + 1];
struct MapObjAct ** moa_ptr_ptr = &world.map_obj_acts;
char * delim = " ";
while (fgets(line, linemax + 1, file))
struct MapObjAct ** moa_ptr_ptr = &world.map_obj_acts;
char * delim = " ";
while (fgets(line, linemax + 1, file))
- for (i = 0, selected = mo->owns;
- i != select;
- i++, selected = selected->next);
+ selected = mo->owns;
+ for (i = 0; i != select; i++, selected = selected->next);