-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: Dynamic weather #2
Conversation
rwgame/RWGame.cpp
Outdated
|
||
// TODO: VC and SA has more than 3 weather conditions | ||
if (state.basic.forcedWeather > 3) { | ||
state.basic.weatherType <= 64 ? ++state.basic.weatherType : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks weird.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 0, | ||
0, 0, 1, 3, 3, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, | ||
2, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 2, 1 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document wether this comes from the game files or wether it's just typed by hand by observing what the game does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented 13c4e76
rwengine/src/engine/GameState.cpp
Outdated
@@ -20,7 +20,7 @@ BasicState::BasicState() | |||
, timeScale2{0} | |||
, lastWeather{0} | |||
, nextWeather{0} | |||
, forcedWeather{0} | |||
, forcedWeather{UINT16_MAX} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Personally I don't like initializing to a constant like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You prefer 65535? I know I do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's equally bad :P why not just 0 like it used to be? I did not remember your comments about weather, but can't this even be a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to UINT16_MAX because based on my research on save games; the forced weather value was 0xFF when weather was not forced with ie. weather cheat. If weather cheat was used then the value was for example 0x03 when forced to foggy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then use... 0xFF or add an enum with a value like: WEATHER_CYCLING = 0xFF
Fixes rwengine#519 ==13884==ERROR: AddressSanitizer: heap-use-after-free on address 0x607000b3d954 at pc 0x0000008ba469 bp 0x7ffd7c8f9ab0 sp 0x7ffd7c8f9aa0 READ of size 4 at 0x607000b3d954 thread T0 #0 0x8ba468 in PlayerController::isTalkingOnPayphone() const /home/maarten/programming/openrw/rwengine/src/ai/PlayerController.cpp:315 #1 0xa148eb in CharacterObject::updateMovementAnimation(float) /home/maarten/programming/openrw/rwengine/src/objects/CharacterObject.cpp:128 #2 0xa185d9 in CharacterObject::updateCharacter(float) /home/maarten/programming/openrw/rwengine/src/objects/CharacterObject.cpp:356 rwengine#3 0xa17735 in CharacterObject::tick(float) /home/maarten/programming/openrw/rwengine/src/objects/CharacterObject.cpp:297 rwengine#4 0x7c7731 in RWGame::tick(float) /home/maarten/programming/openrw/rwgame/RWGame.cpp:541 rwengine#5 0x7c6abb in RWGame::run() /home/maarten/programming/openrw/rwgame/RWGame.cpp:447 rwengine#6 0x793b45 in main /home/maarten/programming/openrw/rwgame/main.cpp:17 rwengine#7 0x7f154c17e18a in __libc_start_main (/lib64/libc.so.6+0x2318a) rwengine#8 0x793839 in _start (/home/maarten/programming/openrw/build/build/rwgame/rwgame+0x793839)
2cba08f
to
f4b2d54
Compare
…qualifiers` in newer ffmpeg versions (rwengine#746) Co-authored-by: Tomi Lähteenmäki <[email protected]>
Closing as I sent this to upstream as rwengine#759. |
Tasklist and some details: