Skip to content

Commit

Permalink
FIx more conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
miguilimzero committed Feb 4, 2024
1 parent 6adcad1 commit b865c04
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/game/server/entities/aura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ void CAura::Snap(int SnappingClient)
if(pOwnerChar->IsAlive())
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);

if(!CmaskIsSet(TeamMask, SnappingClient))
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return;

// Check if char is moving
Expand Down
3 changes: 2 additions & 1 deletion src/game/server/entities/loot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ void CLoot::Snap(int SnappingClient)
if(pOwnerChar && pOwnerChar->IsAlive())
TeamMask = pOwnerChar->Teams()->TeamMask(m_ResponsibleTeam);

if(!CmaskIsSet(TeamMask, SnappingClient))
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return;

if(m_DotsEffect)
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/entities/projectile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void CProjectile::TeleportOwnerToProjectile()
pOwnerChar->m_TeleGunTeleport = true;
pOwnerChar->m_IsBlueTeleGunTeleport = false;

pOwnerChar->Core()->SetHookedPlayer(-1);
pOwnerChar->ResetHook();
}
}
// Finish - OpenGores
Expand Down
3 changes: 2 additions & 1 deletion src/game/server/entities/soundtrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void CSoundtrack::Snap(int SnappingClient)
if(pOwnerChar && pOwnerChar->IsAlive())
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);

if(!CmaskIsSet(TeamMask, SnappingClient))
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return;

float AngleStart = (2.0f * pi * Server()->Tick() / static_cast<float>(Server()->TickSpeed())) / 10.0f;
Expand Down
3 changes: 2 additions & 1 deletion src/game/server/entities/star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ void CStar::Snap(int SnappingClient)
if(pOwnerChar && pOwnerChar->IsAlive())
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);

if(!CmaskIsSet(TeamMask, SnappingClient))
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return;

CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
Expand Down
3 changes: 2 additions & 1 deletion src/game/server/entities/trail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ void CTrail::Snap(int SnappingClient)
if(pOwnerChar && pOwnerChar->IsAlive())
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);

if(!CmaskIsSet(TeamMask, SnappingClient))
CPlayer *pSnapPlayer = GameServer()->m_apPlayers[SnappingClient];
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return;

CNetObj_Projectile *pObj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, m_IDs[0], sizeof(CNetObj_Projectile)));
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/gamecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ int IGameController::SnapRecordFlag(int SnappingClient)
if(SnappingClient != SERVER_DEMO_CLIENT)
{
CClientMask TeamMask = m_pRecordFlagChar->Teams()->TeamMask(m_pRecordFlagChar->Team(), -1, pFlagOwner->GetCID());
if(!CmaskIsSet(TeamMask, SnappingClient))
if(!TeamMask.test(pSnapPlayer->GetTeam()))
return pFlagOwner->GetCID();
}

Expand Down
8 changes: 4 additions & 4 deletions src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ bool CPlayer::CarrySomeone()
if(Player->GetPlayer()->GetCID() != GetCID() && distance(Player->m_Pos, GetCharacter()->m_Pos) < 60)
{
CClientMask TeamMask = GetCharacter()->Teams()->TeamMask(GetCharacter()->Team(), -1, GetCID());
if(!CmaskIsSet(TeamMask, Player->GetPlayer()->GetCID()))
if(!TeamMask.test(Player->GetPlayer()->GetTeam()))
{
continue;
}
Expand Down Expand Up @@ -1389,7 +1389,7 @@ bool CPlayer::TickCarrying()

// Check if the carried player is in a different team mask
CClientMask TeamMask = GetCharacter()->Teams()->TeamMask(GetCharacter()->Team());
if(!CmaskIsSet(TeamMask, m_PowersData.m_CarryCharacter->GetPlayer()->GetCID()))
if(!TeamMask.test(m_PowersData.m_CarryCharacter->GetPlayer()->GetTeam()))
{
return CancelCarrying();
}
Expand All @@ -1405,8 +1405,8 @@ bool CPlayer::TickCarrying()
// }
// }

m_PowersData.m_CarryCharacter->Core()->m_Pos = m_PowersData.m_CarryCharacter->m_Pos = FinalPos; // teeware code
m_PowersData.m_CarryCharacter->Core()->m_Vel = vec2(0, 0); // no speed
m_PowersData.m_CarryCharacter->SetPosition(FinalPos);
m_PowersData.m_CarryCharacter->ResetVelocity(); // no speed
}

m_PowersData.m_CarryTimeRemaining--;
Expand Down

0 comments on commit b865c04

Please sign in to comment.