Random soldier battle animations don´t work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Critical
|
Unassigned |
Bug Description
The init.lua for a soldier contains tables
attack_success_e = {
"atk_ok_e",
},
evade_success_w = {
"eva_ok_w",
},
die_w = {
"die_w",
},
etc. The idea, according to the documentation, is that if several entries exist, one is chosen at random. This is not the case.
When a soldier is killed, it is always the animation named "die_w"/"die_e" that gets called.
If the table looks like this:
die_w = {
"die_w_0",
"die_w_1",
},
and the "animations" table contains no animation named "die_w", the game crashes with:
terminate called after throwing an instance of 'Widelands:
Thread 1 "widelands" received signal SIGABRT, Aborted.
Also, if the animation "die_w" exists but is not listed in the table die_w, it is still the only animation that will be played at the soldier´s death.
Related branches
- TiborB: Approve
-
Diff: 390 lines (+91/-123)12 files modifiedsrc/logic/game_data_error.h (+1/-1)
src/logic/map_objects/immovable.cc (+3/-3)
src/logic/map_objects/map_object.cc (+19/-3)
src/logic/map_objects/map_object.h (+6/-17)
src/logic/map_objects/tribes/building.cc (+5/-4)
src/logic/map_objects/tribes/building.h (+2/-0)
src/logic/map_objects/tribes/constructionsite.cc (+33/-36)
src/logic/map_objects/tribes/constructionsite.h (+7/-0)
src/logic/map_objects/tribes/dismantlesite.cc (+2/-4)
src/logic/map_objects/tribes/soldier.cc (+3/-2)
src/map_io/map_buildingdata_packet.cc (+5/-5)
src/wui/interactive_player.cc (+5/-48)
Changed in widelands: | |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
This might well be buggy, because we don't have any unit with multiple animations yet, so there is nothing to test with.
Can you create a branch with a random animation for testing? Then we can fix the code.