Initial check in of icontext.
This commit is contained in:
19
src/decl.c
19
src/decl.c
@@ -215,9 +215,6 @@ NEARDATA struct monst *migrating_mons = (struct monst *) 0;
|
||||
|
||||
NEARDATA struct mvitals mvitals[NUMMONS];
|
||||
|
||||
/* originally from pickup.c */
|
||||
int oldcap = 0; /* encumbrance */
|
||||
|
||||
NEARDATA struct c_color_names c_color_names = {
|
||||
"black", "amber", "golden", "light blue", "red", "green",
|
||||
"silver", "blue", "purple", "white", "orange"
|
||||
@@ -529,8 +526,6 @@ decl_early_init()
|
||||
ZERO(ubirthday);
|
||||
ZERO(urealtime);
|
||||
|
||||
ZERO(oldcap);
|
||||
|
||||
ZEROARRAY(lastseentyp);
|
||||
|
||||
ZEROPTR(invent);
|
||||
@@ -612,4 +607,18 @@ decl_early_init()
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct instance_context icontext_initial_state = {
|
||||
0, /* oldcap - last encumberance in pickup.c */
|
||||
};
|
||||
|
||||
struct instance_context icontext;
|
||||
|
||||
void
|
||||
icontext_init()
|
||||
{
|
||||
icontext = icontext_initial_state;
|
||||
|
||||
decl_early_init();
|
||||
};
|
||||
|
||||
/*decl.c*/
|
||||
|
||||
@@ -1558,7 +1558,7 @@ encumber_msg()
|
||||
{
|
||||
int newcap = near_capacity();
|
||||
|
||||
if (oldcap < newcap) {
|
||||
if (icontext.oldcap < newcap) {
|
||||
switch (newcap) {
|
||||
case 1:
|
||||
Your("movements are slowed slightly because of your load.");
|
||||
@@ -1576,7 +1576,7 @@ encumber_msg()
|
||||
break;
|
||||
}
|
||||
context.botl = 1;
|
||||
} else if (oldcap > newcap) {
|
||||
} else if (icontext.oldcap > newcap) {
|
||||
switch (newcap) {
|
||||
case 0:
|
||||
Your("movements are now unencumbered.");
|
||||
@@ -1595,7 +1595,7 @@ encumber_msg()
|
||||
context.botl = 1;
|
||||
}
|
||||
|
||||
oldcap = newcap;
|
||||
icontext.oldcap = newcap;
|
||||
return newcap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user