Skip to content

Commit

Permalink
Fix MAX Macro (#1977)
Browse files Browse the repository at this point in the history
Fixes the `MAX` macro to compute return greater of two args.
  • Loading branch information
hohle authored Dec 6, 2024
1 parent 99df394 commit 04586d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define STRCPY(dst, src) __builtin_memcpy(dst, src, sizeof(src))
#define SQ(x) ((x) * (x))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))

#ifdef _MSC_VER
#define __builtin_memcpy memcpy
Expand Down
2 changes: 1 addition & 1 deletion src/st/e_skeleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void EntitySkeletonThrownBone(Entity* self) { // Bone Projectile from Skeleton
self->posY.val -= FIX(0.0625);
xDistanceToPlayer = GetDistanceToPlayerX();
xDistanceToPlayer /= 32;
xDistanceToPlayer = MAX(xDistanceToPlayer, 7);
xDistanceToPlayer = MIN(xDistanceToPlayer, 7);
velocityX = bone_projectile_velocity_x[xDistanceToPlayer];
xDistanceToPlayer = self->facingLeft;

Expand Down

0 comments on commit 04586d0

Please sign in to comment.