Skip to content

Commit

Permalink
Minor tweaks to no player clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
Boondorl authored and madame-rachelle committed Jan 9, 2023
1 parent af0f841 commit 7697968
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/playsim/p_map.cpp
Expand Up @@ -1579,8 +1579,11 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
return true;
}

if (tm.thing->player && P_ShouldPassThroughPlayer(tm.thing->target, thing) && (!(tm.thing->flags8 & MF8_HITOWNER) || tm.thing->target->player != thing->player))
if (tm.thing->target && tm.thing->target != thing &&
tm.thing->target->player && P_ShouldPassThroughPlayer(tm.thing->target, thing))
{
return true;
}

double clipheight;

Expand Down Expand Up @@ -4486,21 +4489,20 @@ static ETraceStatus CheckForActor(FTraceResults &res, void *userdata)
// 3. MTHRUSPECIES on puff and the shooter has same species as the hit actor
// 4. THRUSPECIES on puff and the puff has same species as the hit actor
// 5. THRUGHOST on puff and the GHOST flag on the hit actor
// 6. Skip through players in coop if sv_noplayerclip is enabled
// 6. Matching ThruBits
// 7. A player caller with no player clip enabled

if ((data->ThruActors) ||
(!(data->Spectral) && res.Actor->flags4 & MF4_SPECTRAL) ||
(data->MThruSpecies && res.Actor->GetSpecies() == data->Caller->GetSpecies()) ||
(data->ThruSpecies && res.Actor->GetSpecies() == data->PuffSpecies) ||
(data->hitGhosts && res.Actor->flags3 & MF3_GHOST) ||
(data->UseThruBits && (data->ThruBits & res.Actor->ThruBits)) ||
(data->Caller->player && P_ShouldPassThroughPlayer(data->Caller, res.Actor)))
{
return TRACE_Skip;
}

if (data->UseThruBits && (data->ThruBits & res.Actor->ThruBits))
return TRACE_Skip;

return TRACE_Stop;
}

Expand Down Expand Up @@ -6054,9 +6056,6 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
continue;
}

if (bombsource->player && P_ShouldPassThroughPlayer(bombsource, thing) && thing != bombsource)
continue;

// MBF21
auto targetgroup = thing->GetClass()->ActorInfo()->splash_group;
auto sourcegroup = bombspot->GetClass()->ActorInfo()->splash_group;
Expand All @@ -6078,6 +6077,9 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
continue;
}

if (thing != bombsource && bombsource->player && P_ShouldPassThroughPlayer(bombsource, thing))
continue;

targets.Push(thing);
}

Expand Down

0 comments on commit 7697968

Please sign in to comment.