home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server/C: In actor_use(), don't directly add nutrition to lifepoints.
[plomrogue]
/
src
/
server
/
thing_actions.c
diff --git
a/src/server/thing_actions.c
b/src/server/thing_actions.c
index 2a682c277356f0e4deae6b8bef0ba08a5f936ab3..6a8803d162483a6a3ac06c2fe46dfc05420be31d 100644
(file)
--- a/
src/server/thing_actions.c
+++ b/
src/server/thing_actions.c
@@
-270,11
+270,16
@@
extern void actor_pick(struct Thing * t)
{
struct Thing * picked = NULL;
struct Thing * t_i;
{
struct Thing * picked = NULL;
struct Thing * t_i;
+ uint8_t highest_id = 0;
for (t_i = world.things; t_i; t_i = t_i->next)
{
if (t_i != t && t_i->pos.y == t->pos.y && t_i->pos.x == t->pos.x)
{
for (t_i = world.things; t_i; t_i = t_i->next)
{
if (t_i != t && t_i->pos.y == t->pos.y && t_i->pos.x == t->pos.x)
{
- picked = t_i;
+ if (t_i->id >= highest_id) /* With several Things to pick, */
+ { /* pick the one with the highest ID. */
+ highest_id = t_i->id;
+ picked = t_i;
+ }
}
}
if (picked)
}
}
if (picked)
@@
-319,7
+324,6
@@
extern void actor_use(struct Thing * t)
}
t->satiation = t->satiation + tt->consumable > INT16_MAX ?
INT16_MAX : t->satiation + tt->consumable;
}
t->satiation = t->satiation + tt->consumable > INT16_MAX ?
INT16_MAX : t->satiation + tt->consumable;
- t->lifepoints = t->lifepoints + tt->consumable;
}
}
if (t == get_player())
}
}
if (t == get_player())