mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-27 09:24:53 +00:00
fixed loading pre-bow character styles (fixes crashes on loading races)
This commit is contained in:
parent
24c196db15
commit
cd7af38e2e
22
config.cpp
22
config.cpp
@ -876,6 +876,12 @@ struct charstyle_old {
|
|||||||
bool lefthanded;
|
bool lefthanded;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct charstyle_prebow {
|
||||||
|
int charid;
|
||||||
|
color_t skincolor, haircolor, dresscolor, swordcolor, dresscolor2, uicolor, eyecolor;
|
||||||
|
bool lefthanded;
|
||||||
|
};
|
||||||
|
|
||||||
EX void hread(hstream& hs, charstyle& cs) {
|
EX void hread(hstream& hs, charstyle& cs) {
|
||||||
// before 0xA61A there was no eyecolor
|
// before 0xA61A there was no eyecolor
|
||||||
if(hs.get_vernum() < 0xA61A) {
|
if(hs.get_vernum() < 0xA61A) {
|
||||||
@ -889,7 +895,21 @@ EX void hread(hstream& hs, charstyle& cs) {
|
|||||||
if(cs.charid < 4) cs.eyecolor = 0;
|
if(cs.charid < 4) cs.eyecolor = 0;
|
||||||
cs.dresscolor2 = cso.dresscolor2;
|
cs.dresscolor2 = cso.dresscolor2;
|
||||||
cs.uicolor = cso.uicolor;
|
cs.uicolor = cso.uicolor;
|
||||||
cs.lefthanded = cso.lefthanded;
|
cs.lefthanded = cso.lefthanded;
|
||||||
|
}
|
||||||
|
else if(hs.get_vernum() < 0xA938) {
|
||||||
|
charstyle_prebow cso;
|
||||||
|
hread_raw(hs, cso);
|
||||||
|
cs.charid = cso.charid;
|
||||||
|
cs.skincolor = cso.skincolor;
|
||||||
|
cs.haircolor = cso.haircolor;
|
||||||
|
cs.dresscolor = cso.dresscolor;
|
||||||
|
cs.eyecolor = cso.eyecolor;
|
||||||
|
cs.swordcolor = cs.bowcolor = cs.bowcolor2 = cso.swordcolor;
|
||||||
|
if(cs.charid < 4) cs.eyecolor = 0;
|
||||||
|
cs.dresscolor2 = cso.dresscolor2;
|
||||||
|
cs.uicolor = cso.uicolor;
|
||||||
|
cs.lefthanded = cso.lefthanded;
|
||||||
}
|
}
|
||||||
else hread_raw(hs, cs);
|
else hread_raw(hs, cs);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user