1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-11 09:50:34 +00:00

sword:: fixed a possible crash on incomplete maps

This commit is contained in:
Zeno Rogue 2021-07-29 14:46:59 +02:00
parent f92e26dc00
commit ced16a2f4e

View File

@ -2881,6 +2881,7 @@ EX namespace sword {
int sub = (hybri) ? 2 : 0;
int t2 = c2->type - sub;
int t1 = c1->type - sub;
if(t1 == 0 || t2 == 0) return d;
if(c1->c.mirror(s1))
d.angle = ((s2*sword_angles/t2 - d.angle + s1*sword_angles/t1) + sword_angles/2) % sword_angles;
else