Skip to content

Add wanted level sync#78

Open
1337Crakker wants to merge 4 commits intoTornamic:mainfrom
1337Crakker:wanted-level-sync
Open

Add wanted level sync#78
1337Crakker wants to merge 4 commits intoTornamic:mainfrom
1337Crakker:wanted-level-sync

Conversation

@1337Crakker
Copy link

Summary

Syncs wanted levels across all connected players using a shared max approach - the highest wanted level among all players is applied to everyone.

How it works

Each player tracks their own wanted level separately. When it changes (crimes, bribes, death), the update is sent to the server and relayed to all clients. Each client computes max(own level, all remote levels) and writes it directly to CWanted::m_nWantedLevel (avoids SetWantedLevelNoDrop which pollutes chaos level and causes stars to persist after death).

Tested scenarios

  • Committing crimes syncs stars to all players
  • All players dying resets stars to 0
  • New player joining receives current wanted state
  • Player disconnecting triggers shared max recalculation
  • AEZAKMI and Bribe pickup work but only for the host
  • Pay 'n' Spray works (might only be for host too? didn't test)

@Tornamic
Copy link
Owner

Tornamic commented Feb 6, 2026

will review and test ASAP

@Tornamic
Copy link
Owner

Tornamic commented Feb 6, 2026

@1337Crakker how can i get in touch with you? discord/telegram or anything?

@1337Crakker
Copy link
Author

Addressed all issues in the fix commit. I couldn't reproduce stars flashing bug so I hope it's fixed :P

@1337Crakker 1337Crakker closed this Feb 7, 2026
@1337Crakker 1337Crakker reopened this Feb 7, 2026
@1337Crakker
Copy link
Author

  • Wanted levels are per-player, earned from your own crimes
  • Stars only sync when players share the same vehicle, boosted to the highest occupant's level
  • On exit you keep the stars, they decay naturally through normal gameplay
  • No proximity sharing, standing near a wanted player does nothing
  • Pay 'n' Spray clears wanted level only for players in the same car

@1337Crakker
Copy link
Author

When other player causes an explosion the game was attributing that crime to the local player, giving them stars they didn't earn. This commit fixes this, so the game doesn't blame you for someone else's explosions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants