mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-10-18 19:22:41 +00:00
Check if env region index is greater than 0 (#285)
This commit is contained in:
parent
ea8e7b75d8
commit
761cd5b66b
1 changed files with 2 additions and 4 deletions
|
@ -337,16 +337,14 @@ void movtexqc_register(const char* name, s16 level, s16 area, s16 type) {
|
|||
///
|
||||
|
||||
f32 get_environment_region(u8 index) {
|
||||
if (gEnvironmentRegions != NULL && index <= gEnvironmentRegions[0]) {
|
||||
if (gEnvironmentRegions != NULL && index > 0 && index <= gEnvironmentRegions[0]) {
|
||||
return gEnvironmentRegions[6 * (int)index];
|
||||
}
|
||||
return gLevelValues.floorLowerLimit;
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
void set_environment_region(u8 index, s32 value) {
|
||||
if (gEnvironmentRegions != NULL && index <= gEnvironmentRegions[0]) {
|
||||
if (gEnvironmentRegions != NULL && index > 0 && index <= gEnvironmentRegions[0]) {
|
||||
gEnvironmentRegions[6 * (int)index] = value;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue