mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fixed crash in init_shadow()
This commit is contained in:
parent
c0e1579fce
commit
f73c841bfe
2 changed files with 4 additions and 1 deletions
|
|
@ -736,7 +736,7 @@ static u16 atan2_lookup(f32 y, f32 x) {
|
|||
ret = gArctanTable[0];
|
||||
} else {
|
||||
s32 index = (s32)(y / x * 1024 + 0.5f);
|
||||
if (index >= 0x401) { index = 0; }
|
||||
if (index >= 0x401 || index < 0) { index = 0; }
|
||||
ret = gArctanTable[index];
|
||||
}
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -234,6 +234,9 @@ s8 init_shadow(struct Shadow *s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale,
|
|||
s->floorNormalY = floorGeometry->normalY;
|
||||
s->floorNormalZ = floorGeometry->normalZ;
|
||||
s->floorOriginOffset = floorGeometry->originOffset;
|
||||
} else {
|
||||
// You can't draw a shadow with no floor under you.
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (overwriteSolidity) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue