Skip to content

Commit

Permalink
Fix for HCZ Act 2
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMelon committed Jun 17, 2023
1 parent b1c8619 commit 49e20e9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,30 @@ SnolfMania/Objects/Snolf.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/SnolfMania.dir/build.make CMakeFiles/SnolfMania.dir/SnolfMania/Objects/Snolf.c.s
.PHONY : SnolfMania/Objects/Snolf.c.s

SnolfMania/Objects/Starpost.o: SnolfMania/Objects/Starpost.c.o
.PHONY : SnolfMania/Objects/Starpost.o

# target to build an object file
SnolfMania/Objects/Starpost.c.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/SnolfMania.dir/build.make CMakeFiles/SnolfMania.dir/SnolfMania/Objects/Starpost.c.o
.PHONY : SnolfMania/Objects/Starpost.c.o

SnolfMania/Objects/Starpost.i: SnolfMania/Objects/Starpost.c.i
.PHONY : SnolfMania/Objects/Starpost.i

# target to preprocess a source file
SnolfMania/Objects/Starpost.c.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/SnolfMania.dir/build.make CMakeFiles/SnolfMania.dir/SnolfMania/Objects/Starpost.c.i
.PHONY : SnolfMania/Objects/Starpost.c.i

SnolfMania/Objects/Starpost.s: SnolfMania/Objects/Starpost.c.s
.PHONY : SnolfMania/Objects/Starpost.s

# target to generate assembly for a file
SnolfMania/Objects/Starpost.c.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/SnolfMania.dir/build.make CMakeFiles/SnolfMania.dir/SnolfMania/Objects/Starpost.c.s
.PHONY : SnolfMania/Objects/Starpost.c.s

SnolfMania/Objects/Zone.o: SnolfMania/Objects/Zone.c.o
.PHONY : SnolfMania/Objects/Zone.o

Expand Down Expand Up @@ -294,6 +318,9 @@ help:
@echo "... SnolfMania/Objects/Snolf.o"
@echo "... SnolfMania/Objects/Snolf.i"
@echo "... SnolfMania/Objects/Snolf.s"
@echo "... SnolfMania/Objects/Starpost.o"
@echo "... SnolfMania/Objects/Starpost.i"
@echo "... SnolfMania/Objects/Starpost.s"
@echo "... SnolfMania/Objects/Zone.o"
@echo "... SnolfMania/Objects/Zone.i"
@echo "... SnolfMania/Objects/Zone.s"
Expand Down
4 changes: 3 additions & 1 deletion SnolfMania/Objects/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ extern void (*Player_HandleGroundRotation)();
extern void (*Player_HandleGroundMovement)();
extern void (*Player_HandleGroundAnimation)();
extern void (*Player_Gravity_False)();
extern void (*Player_Input_P1)();
extern void (*Player_Input_P2_Player)();
extern void (*HUD_DrawNumbersBase10)(Vector2 *drawPos, int32 value, int32 digitCount);

// Override Functions
Expand All @@ -555,4 +557,4 @@ void Player_HandleIdleAnimation(void);
bool32 Snolf_EnsureInfiniteLives(bool32 skipped);
void Snolf_DoWallBounces();

#endif //! OBJ_PLAYER_H
#endif //! OBJ_PLAYER_H
3 changes: 2 additions & 1 deletion SnolfMania/Objects/Snolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

bool32 ShouldRunSnolfCode(EntityPlayer *entity)
{
if (entity->stateInput == StateMachine_None)
if (entity->stateInput != Player_Input_P1 && entity->stateInput != Player_Input_P2_Player)
return false;

if (entity->state == Player_State_Static)
Expand All @@ -15,6 +15,7 @@ bool32 ShouldRunSnolfCode(EntityPlayer *entity)
if (entity->sidekick) // Temporary fix for launch day bug.
return false;


return true;
}

Expand Down
5 changes: 5 additions & 0 deletions SnolfMania/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ void (*Player_HandleAirMovement)();
void (*Player_HandleGroundRotation)();
void (*Player_HandleGroundMovement)();
void (*HUD_DrawNumbersBase10)(Vector2 *drawPos, int32 value, int32 digitCount) = NULL;
void (*Player_Input_P1)();
void (*Player_Input_P2_Player)();

StateMachine(Player_State_Ground);
StateMachine(Player_State_Roll);
Expand Down Expand Up @@ -62,6 +64,9 @@ void InitModAPI(void)
Player_HandleAirMovement = Mod.GetPublicFunction(NULL, "Player_HandleAirMovement");
Player_HandleGroundRotation = Mod.GetPublicFunction(NULL, "Player_HandleGroundRotation");
Player_HandleGroundMovement = Mod.GetPublicFunction(NULL, "Player_HandleGroundMovement");
Player_Input_P1 = Mod.GetPublicFunction(NULL, "Player_Input_P1");
Player_Input_P2_Player = Mod.GetPublicFunction(NULL, "Player_Input_P2_Player");

HUD_DrawNumbersBase10 = Mod.GetPublicFunction(NULL, "HUD_DrawNumbersBase10");

Dust_State_DustTrail = Mod.GetPublicFunction(NULL, "Dust_State_DustTrail");
Expand Down

0 comments on commit 49e20e9

Please sign in to comment.