PatR [Sun, 25 Nov 2018 23:36:54 +0000 (15:36 -0800)]
github pull request #163 - bag of holding weight
Fixes #163
Fixes #153
Encumbrance calculations for taking things out of a bag of holding
where subject to rounding issues due to integer division. This may
improve things, although I think taking out a partial stack might not
be much better than before.
I simplified the contributed code, then decided that it wasn't an
improvement. In the process of switching back and forth I may have
introduced bugs which weren't present originally.
nhmall [Sun, 25 Nov 2018 17:47:53 +0000 (12:47 -0500)]
more orctown-related follow-up
Under some circumstances, when all the marauding orcs belonging to the
horde operating within the gnomish mines had been provided with their
spoils and placed appropriately, there could still be some pillaged stuff
left-over on the migrating obj chain. Orcs created by regular monster
generation elsewhere would then be susceptable to receiving that stuff
until it was used up. That part is fine, except that the orcs were then
being named as part of the same horde operating within the mines. Now
they will no longer be named as part of the Gnomish Mines horde.
Mythos: There's a good chance that these particular orcs received the
stolen goods from the Gnomish Mines horde.
nhmall [Sun, 25 Nov 2018 04:14:20 +0000 (23:14 -0500)]
adjust sample config file when STATUS_HILITES isn't defined
On Windows, if you build without STATUS_HILITES defined,
you'll be greeted by the following barrage of errors when
you start the game.
On Windows, use makedefs to detect that STATUS_HILITES
isn't defined, and comment out the offending lines in
the sample config file.
Errors received before this change:
OPTIONS=statushilites
* Line 197: 'statushilites' is not supported.
OPTIONS=hilite_status:hitpoints/100%/gray&normal
* Line 200: 'hilite_status' is not supported.
OPTIONS=hilite_status:hitpoints/<100%/green&normal
* Line 201: 'hilite_status' is not supported.
OPTIONS=hilite_status:hitpoints/<66%/yellow&normal
* Line 202: 'hilite_status' is not supported.
OPTIONS=hilite_status:hitpoints/<50%/orange&normal
* Line 203: 'hilite_status' is not supported.
OPTIONS=hilite_status:hitpoints/<33%/red&bold
* Line 204: 'hilite_status' is not supported.
OPTIONS=hilite_status:hitpoints/<15%/red&inverse
* Line 205: 'hilite_status' is not supported.
OPTIONS=hilite_status:power/100%/gray&normal
* Line 208: 'hilite_status' is not supported.
OPTIONS=hilite_status:power/<100%/green&normal
* Line 209: 'hilite_status' is not supported.
OPTIONS=hilite_status:power/<66%/yellow&normal
* Line 210: 'hilite_status' is not supported.
OPTIONS=hilite_status:power/<50%/orange&normal
* Line 211: 'hilite_status' is not supported.
OPTIONS=hilite_status:power/<33%/red&bold
* Line 212: 'hilite_status' is not supported.
OPTIONS=hilite_status:cap/burdened/yellow/stressed/orange/strained/red&bold/ove
rtaxed/red&inverse/overloaded/red&inverse&blink
* Line 215: 'hilite_status' is not supported.
OPTIONS=hilite_status:hunger/satiated/yellow/hungry/orange/weak/red&bold/fainti
ng/red&inverse/fainted/red&inverse&blink
* Line 218: 'hilite_status' is not supported.
Hit <Enter> to continue.
PatR [Sat, 24 Nov 2018 23:22:33 +0000 (15:22 -0800)]
fix github pull request #161 - scatter()
Fixes #161
Report states that scattering objects might leave a 'pile' glyph when
no longer appropriate. I didn't try to reproduce that, just took it
on faith. The fix tried to be too efficient and might have missed
fixing the display if breaks() or ohitmon() destroyed the objects
being scattered and left 'total' at 0.
PatR [Sat, 24 Nov 2018 09:45:09 +0000 (01:45 -0800)]
fix #H7591 - migrating monsters vs full levels
During level change, when a monster from mydogs (monsters accompaying
hero, usually pets) couldn't be placed because the level was full, it
was set to migrate to that level (in order to get another chance to
arrive if hero left and returned). The code sequence
mon_arrive()-> mnexto()-> m_into_limbo()-> migrate_to_level()-> relmon()
tried to remove the monster from the map, but it wasn't necessarily on
the map (depending upon whether it couldn't arrive at all, or arrived
at the hero's spot and couldn't be moved out of the hero's way). The
EXTRA_SANITY_CHECKS for remove_monster() issued impossible "no monster
to remove". relmon() now checks whether monster is already off the map.
While investigating that, I discovered that pets set to re-migrate
to the same level to try again on hero's next visit didn't work at all.
migrating_mons gets processed after mydogs so moving something from
the latter to the former after arrival failure just resulted in
immediate second failure when the more general list was handled during
the hero's current arrival. And failure to arrive from migrating_mons
would kill the monster instead of scheduling another attempt.
The sanest fix for that turned out to be to have all monsters who
can't arrive be put back on the migrating_mons list to try again upon
hero's next visit. Pets still fail twice but are no longer discarded
during the second time, and now do arrive when hero leaves and comes
back provided he or she has opened up some space before leaving. If
there's still no space on the next visit, monsters who can't arrive
then are scheduled to try again on the visit after that.
Recent fix for invalid corpses becomes moot. Monsters aren't killed
during arrival failure so there are no resulting corpses to deal with.
Bart House [Thu, 22 Nov 2018 23:20:17 +0000 (15:20 -0800)]
Added decl_early_init() which is called when PLAYAGAIN is supported.
decl_early_init() is called when we are starting a game. On first
start, it validates that global state is in the expected state.
When called on subsequent starts, it initializes global state to
expected state.
Bart House [Thu, 22 Nov 2018 18:15:43 +0000 (10:15 -0800)]
Removed unnecessary use of static for nocreate values.
If multiple games are played without exiting the process, on the second
new player creation the nocreate values will already be set based
on the first player creation.