Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driving & safemode fixes (PWR) #4771

Merged
merged 11 commits into from Dec 1, 2013
Merged

Conversation

KA101
Copy link
Contributor

@KA101 KA101 commented Nov 30, 2013

In response to http://smf.cataclysmdda.com/index.php?topic=4541.0 . Looks like vehicle-safemode may have been the culprit, but Web Weaver certainly contributed. Noe Web Weaver's in player.cpp where it belongs and the option calls go direct, thus providing the sort of realtime-changing that players'll want.

Tested and works. Feel free to pull when ready.

(I thought the engine-upgrade merited a Help update, too. #4770 is a good solution too.)

Egad! some of my text ran off the side of the screen D:

Fixed now.
I still haven't got it to display the message when driving with
vehiclesafemode on & hostile, but Web Weaver now works properly.  As in,
safe mode trumps weaving.
We ought to let people know that they have to manually turn the key.
Easy to forget!
Vagueness is not our friend here.
Adds parens to fix Jenkins warning.
@@ -2067,14 +2067,15 @@ bool game::handle_action()
switch (act) {

case ACTION_PAUSE:
if (run_mode == 2 && (u.controlling_vehicle && safemodeveh) ) { // Monsters around and we don't wanna pause
if (run_mode == 2 && ((u.controlling_vehicle && safemodeveh) || !(u.controlling_vehicle))) { // Monsters around and we don't wanna pause
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really strange, and caught my eye. It's semantically identical to run_mode == 2 && (safemodeveh || !u.controlling_vehicle), and I'm not sure if that's the actual intent of the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that streamlines things. Was intended to have safemode both stop the action and throw the warning; it wasn't kicking in when on foot, likely thanks to the Web Weaver action. As this stands, it stops you just fine but doesn't throw the warning when you're driving.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, yep, that'll do it. In plain English: "if we're in safe mode and a monster is detected, and either we're not driving, or else we're driving but the player doesn't want to trigger safe-mode while driving".

This reverts commit fa93876.
Hopefully this fixes the style problem and makes sure people look in the
VehCtrl menu for things.
Got Web Weaver into player.cpp where it probably belonged.  Still
working on getting safemodeveh to actually work properly.  This code
appears to jam it in the "on" position.  Not sure whether that's a
problem with me Xing out of the process on WinXP, or if it's not saving
properly, or if there's something else messed up.
@KA101
Copy link
Contributor Author

KA101 commented Nov 30, 2013

Check that: "Cleanup a bit" jams vehicle-safemode in the Off position, not the On. You can jam it On by changing the "else" to "if (run_mode <=1) and bracing the u.pause.

@KA101 KA101 closed this Nov 30, 2013
@KA101 KA101 reopened this Nov 30, 2013
Turns out it was only updating when you load your save, rather than
checking at game start.

Still isn't loading from accessing the options menu in-game.
@KA101
Copy link
Contributor Author

KA101 commented Dec 1, 2013

@narc0tiq was quite helpful on the trace there. Thanks much.

As it happens, this was the quickest way to make sure it updated
dynamically.
@atomicdryad atomicdryad merged commit 7fd9c44 into CleverRaven:master Dec 1, 2013
@KA101 KA101 deleted the FixSafePause branch December 1, 2013 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants