-
Notifications
You must be signed in to change notification settings - Fork 637
[Anchor] Add PVP damage multiplier #6011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,11 +21,13 @@ nlohmann::json Anchor::PrepRoomState() { | |
| if (isGlobalRoom) { | ||
| // Global room uses hardcoded settings | ||
| payload["pvpMode"] = 0; | ||
| payload["pvpDamageMult"] = 0; | ||
| payload["showLocationsMode"] = 0; | ||
| payload["teleportMode"] = 0; | ||
| payload["syncItemsAndFlags"] = 0; | ||
| } else { | ||
| payload["pvpMode"] = CVarGetInteger(CVAR_REMOTE_ANCHOR("RoomSettings.PvpMode"), 1); | ||
| payload["pvpDamageMult"] = CVarGetInteger(CVAR_REMOTE_ANCHOR("RoomSettings.PvpDamageMult"), 1); | ||
| payload["showLocationsMode"] = CVarGetInteger(CVAR_REMOTE_ANCHOR("RoomSettings.ShowLocationsMode"), 1); | ||
| payload["teleportMode"] = CVarGetInteger(CVAR_REMOTE_ANCHOR("RoomSettings.TeleportMode"), 1); | ||
| payload["syncItemsAndFlags"] = CVarGetInteger(CVAR_REMOTE_ANCHOR("RoomSettings.SyncItemsAndFlags"), 1); | ||
|
|
@@ -49,6 +51,7 @@ void Anchor::HandlePacket_UpdateRoomState(nlohmann::json payload) { | |
|
|
||
| roomState.ownerClientId = payload["state"]["ownerClientId"].get<uint32_t>(); | ||
| roomState.pvpMode = payload["state"]["pvpMode"].get<u8>(); | ||
| roomState.pvpDamageMult = payload["state"]["pvpDamageMult"].get<u8>(); | ||
|
||
| roomState.showLocationsMode = payload["state"]["showLocationsMode"].get<u8>(); | ||
| roomState.teleportMode = payload["state"]["teleportMode"].get<u8>(); | ||
| roomState.syncItemsAndFlags = payload["state"]["syncItemsAndFlags"].get<u8>(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a u8, with OHKO you're going to overflow it
passing damage as parameter to
GetPvpDamageMultiplieryou could have OHKO ignore damage value & return 63 (need to avoid overflow from* 4). But I'm also thinking might as well push the* 4down too, renamingGetPvpDamageMultipliertoTransformPvpDamage