mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-05 15:11:16 +00:00
Shrink PVP hitboxes and re-add angle checks
This commit is contained in:
parent
ba4ad874f4
commit
be3967ab4e
2 changed files with 7 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "pc/network/network.h"
|
||||
#include "pc/network/lag_compensation.h"
|
||||
#include "pc/lua/smlua_hooks.h"
|
||||
#include "pc/pc_main.h"
|
||||
|
||||
u8 sDelayInvincTimer;
|
||||
s16 gInteractionInvulnerable;
|
||||
|
@ -177,6 +178,10 @@ s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o) {
|
|||
static u32 determine_interaction_internal(struct MarioState *m, struct Object *o, u8 isPVP) {
|
||||
if (!m || !o) { return 0; }
|
||||
|
||||
// when set to false, angle checks apply again. I would just restore the original
|
||||
// determine_interaction function but this is easier with keeping compatibility
|
||||
if (!gCoopCompatibility) { isPVP = FALSE; }
|
||||
|
||||
u32 interaction = 0;
|
||||
u32 action = m->action;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "object_list_processor.h"
|
||||
#include "spawn_object.h"
|
||||
#include "pc/network/network_player.h"
|
||||
#include "pc/pc_main.h"
|
||||
|
||||
struct Object *debug_print_obj_collision(struct Object *a) {
|
||||
if (!a) { return NULL; }
|
||||
|
@ -38,7 +39,7 @@ int detect_player_hitbox_overlap(struct MarioState* local, struct MarioState* re
|
|||
f32 dx = aTorso[0] - bTorso[0];
|
||||
UNUSED f32 sp30 = sp3C - sp38;
|
||||
f32 dz = aTorso[2] - bTorso[2];
|
||||
f32 collisionRadius = (a->hitboxRadius + b->hitboxRadius) * 2.25f;
|
||||
f32 collisionRadius = (a->hitboxRadius + b->hitboxRadius) * (gCoopCompatibility ? 2.25f : 1.5f);
|
||||
f32 distance = sqrtf(dx * dx + dz * dz);
|
||||
|
||||
if (collisionRadius * scale > distance) {
|
||||
|
|
Loading…
Reference in a new issue