mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-26 00:47:00 +00:00
sword:: fixed a possible crash on incomplete maps
This commit is contained in:
parent
f92e26dc00
commit
ced16a2f4e
@ -2881,6 +2881,7 @@ EX namespace sword {
|
|||||||
int sub = (hybri) ? 2 : 0;
|
int sub = (hybri) ? 2 : 0;
|
||||||
int t2 = c2->type - sub;
|
int t2 = c2->type - sub;
|
||||||
int t1 = c1->type - sub;
|
int t1 = c1->type - sub;
|
||||||
|
if(t1 == 0 || t2 == 0) return d;
|
||||||
if(c1->c.mirror(s1))
|
if(c1->c.mirror(s1))
|
||||||
d.angle = ((s2*sword_angles/t2 - d.angle + s1*sword_angles/t1) + sword_angles/2) % sword_angles;
|
d.angle = ((s2*sword_angles/t2 - d.angle + s1*sword_angles/t1) + sword_angles/2) % sword_angles;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user