Fixed fish bug

Also changed applicable files to only import configfile if NODRAWINGDISTANCE is not used (otherwise it's an unused import)
This commit is contained in:
GateGuy 2020-11-26 16:11:47 -05:00
parent e2b2309c31
commit 38d6c1f615
22 changed files with 49 additions and 5 deletions

View File

@ -13,7 +13,9 @@
#include "game/object_list_processor.h"
#include "graph_node.h"
#include "surface_collision.h"
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// Macros for retrieving arguments from behavior scripts.
#define BHV_CMD_GET_1ST_U8(index) (u8)((gCurBhvCommand[index] >> 24) & 0xFF) // unused

View File

@ -14,7 +14,9 @@
#include "game/mario.h"
#include "game/object_list_processor.h"
#include "surface_load.h"
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
s32 unused8038BE90;

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// bub.c.inc

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// coin.c.inc

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**
* @file fish.inc.c
@ -21,22 +23,22 @@ void fish_act_spawn(void) {
// Blue fish with a quanitiy of twenty.
case 0:
model = MODEL_FISH; schoolQuantity = 20; minDistToMario = 15 * configDrawDistance; fishAnimation = blue_fish_seg3_anims_0301C2B0;
model = MODEL_FISH; schoolQuantity = 20; minDistToMario = 15; fishAnimation = blue_fish_seg3_anims_0301C2B0;
break;
// Blue fish with a quanitiy of five.
case 1:
model = MODEL_FISH; schoolQuantity = 5; minDistToMario = 15 * configDrawDistance; fishAnimation = blue_fish_seg3_anims_0301C2B0;
model = MODEL_FISH; schoolQuantity = 5; minDistToMario = 15; fishAnimation = blue_fish_seg3_anims_0301C2B0;
break;
// Cyan fish with a quanitiy of twenty.
case 2:
model = MODEL_CYAN_FISH; schoolQuantity = 20; minDistToMario = 15 * configDrawDistance; fishAnimation = cyan_fish_seg6_anims_0600E264;
model = MODEL_CYAN_FISH; schoolQuantity = 20; minDistToMario = 15; fishAnimation = cyan_fish_seg6_anims_0600E264;
break;
// Cyan fish with a quanitiy of five.
case 3:
model = MODEL_CYAN_FISH; schoolQuantity = 5; minDistToMario = 15 * configDrawDistance; fishAnimation = cyan_fish_seg6_anims_0600E264;
model = MODEL_CYAN_FISH; schoolQuantity = 5; minDistToMario = 15; fishAnimation = cyan_fish_seg6_anims_0600E264;
break;
}
/**
@ -45,7 +47,7 @@ void fish_act_spawn(void) {
* Fish moves at random with a max-range of 700.0f.
*/
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) {
if (o->oDistanceToMario < minDistToMario * configDrawDistance / 100 || gCurrLevelNum == LEVEL_SA) {
#endif
for (i = 0; i < schoolQuantity; i++) {
fishObject = spawn_object(o, model, bhvFish);

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// heave_ho.c.inc

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// king_bobomb.c.inc

View File

@ -1,6 +1,8 @@
// lll_floating_wood_piece.c.inc
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
void bhv_lll_wood_piece_loop(void) {
if (o->oTimer == 0)

View File

@ -1,6 +1,8 @@
// lll_rotating_hex_flame.c.inc
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
void bhv_lll_rotating_hex_flame_loop(void) {
f32 sp24 = o->oLllRotatingHexFlameUnkF4;

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**
* Behavior for bhvPiranhaPlant.

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// sl_walking_penguin.c.inc

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
/**
* Behavior file for bhvSnufit and bhvSnufitBalls.

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
struct TripletButterflyActivationData {
s32 model;

View File

@ -1,6 +1,8 @@
// water_bomb_cannon.inc.c
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
void bhv_bubble_cannon_barrel_loop(void) {
struct Object *val04;

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// whirlpool.c.inc

View File

@ -1,4 +1,6 @@
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
// whomp.c.inc

View File

@ -27,7 +27,9 @@
#include "obj_behaviors.h"
#include "object_helpers.h"
#include "object_list_processor.h"
#ifndef NODRAWINGDISTANCE
#include "pc/configfile.h"
#endif
#include "rendering_graph_node.h"
#include "save_file.h"
#include "spawn_object.h"