widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #03719
[Merge] lp:~widelands-dev/widelands/bug-1422452 into lp:widelands
TiborB has proposed merging lp:~widelands-dev/widelands/bug-1422452 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1422452 in widelands: "REPLAY: Caught exception [c:/data/bzr/widelands/working/src/logic/replay.cc:182] Unknown packet 0"
https://bugs.launchpad.net/widelands/+bug/1422452
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1422452/+merge/250232
So many hours of work and so tiny fix. :(
There is a question in a diff....
I have not tested the attached (to the bug) file, but I have own replay files that were broken before and "worked" after the fix
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1422452 into lp:widelands.
=== modified file 'src/logic/playercommand.cc'
--- src/logic/playercommand.cc 2015-02-13 18:48:37 +0000
+++ src/logic/playercommand.cc 2015-02-18 22:41:01 +0000
@@ -910,7 +910,14 @@
PlayerCommand (0, des.unsigned_8())
{
serial = des.unsigned_32();
- scouting_direction = ScoutingDirection::kClockwise;
+ //NOCOM - coding question
+ //can I cast uint8_t to ScoutingDirection directly???
+ uint8_t unsign = des.unsigned_8();
+ if (static_cast<uint8_t>(ScoutingDirection::kClockwise) == unsign) {
+ scouting_direction = ScoutingDirection::kClockwise;
+ } else {
+ scouting_direction = ScoutingDirection::kCounterClockwise;
+ }
}
void CmdShipExploreIsland::execute (Game & game)
Follow ups