Commit Graph
404 Commits
Author SHA1 Message Date
Anders Jenbo 21fd0fb686 Split delta sync from realtime sync 2022-06-27 10:17:22 +02:00
obligaron 88a0b5ba60 IsValidLevelForMultiplayer: Fix last set level is wrongly assumed as invalid 2022-06-25 18:02:28 +02:00
obligaron d94380953e Fix automap not saved in multiplayer quest/set-maps 2022-06-25 13:06:16 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
obligaron 184290a977 Support setlevel in multiplayer 2022-06-18 17:05:30 +02:00
obligaron e151274fdf Introduce IsValidLevel 2022-06-18 17:05:30 +02:00
obligaron 22a113d3a6 Introduce GetLevelForMultiplayer 2022-06-18 17:05:30 +02:00
obligaron 766fdf74df Change IOwnLevel from nReqLevel to player 2022-06-18 17:05:30 +02:00
obligaron 6210f57e82 Change DeltaSyncObject and DeltaPutItem from bLevel to Player 2022-06-18 17:05:30 +02:00
obligaron 8637e05650 Remove bLevel from delta_kill_monster_ and delta_monster_hp 2022-06-18 17:05:30 +02:00
obligaron 783db07cbf Replace CMD_DLEVEL_0/_1/... with generic CMD_DLEVEL 2022-06-18 17:05:30 +02:00
obligaron 303735777e Store delta level information in unordered_map 2022-06-18 17:05:30 +02:00
obligaron 29e4ec4ef1 Move delta structs to msg.cpp 2022-06-18 17:05:30 +02:00
obligaron 316279fdd2 Reduce use of sgLevels 2022-06-18 17:05:30 +02:00
obligaron d0c14fe92f Introduce Player::setlevel 2022-06-18 17:05:30 +02:00
obligaron 19749420b5 Introduce Player::isOnActiveLevel 2022-06-18 17:05:30 +02:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +02:00
staphen a2fe3a981e Fix issues with ears due to translation 2022-06-06 07:26:43 +02:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
Anders Jenbo 895057584e Use mtype instead of index id to check for golem monsters 2022-05-23 07:31:50 +02:00
obligaron 2b0b944afb Manage friendly mode per player and sync state between clients 2022-05-20 22:46:48 +02:00
qndel 944655ff94 fix typos (#4568) 2022-05-12 08:25:55 +02:00
obligaron d921fb3e97 Throttle send player commands to avoid desyncs 2022-04-22 23:23:51 +02:00
obligaron daf299940e ADL: Fix PreviewFrame for some spells 2022-04-22 23:23:43 +02:00
ephphatha 64a2c41b2c Set clang-tidy config for MethodCase option
Previously this was falling back to FunctionCase, leading to inconsistent casing of class methods throughout the codebase. Applied to Item as an example.
2022-04-20 13:50:57 +02:00
ephphatha 28b6eaf7de Only use HoldItem in InvGetItem if necessary
When auto-placing gold in the inventory there's no need to trample HoldItem.
2022-04-18 17:41:01 +02:00
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
Gleb Mazovetskiy ade8aba822 Fix some more warnings 2022-04-14 01:26:29 +02:00
staphen d16c2f0086 Avoid recreating items in PutItem locally 2022-04-10 23:37:33 +02:00
staphen 33338115f6 Don't use HoldItem in CMD_PUTITEM handler 2022-03-31 11:43:58 +02:00
ephphatha 92fcdda3a7 Refactor OnHealOther to operate on Player references 2022-03-30 00:49:56 +02:00
staphen 822a0cd22a Fix auto-equip network messages 2022-03-27 18:26:43 +02:00
Anders Jenbo 55a0b71b1c Only spawn loot once 2022-03-20 11:12:08 +01:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Andrew James f64d17bfa9 Initial clean up of code related to creating items (#2943)
* Move declaration of dItems to items.cpp

This array is never used in dungeon generation, it's closely related to Items so should be kept together. Ideally managing dItems can become responsibility of a container for Items, which will handle adding/removing items from the list and keeping the positions in sync.

* Rename SetPlrHandItem to match purpose/use

* Give more descriptive name to GetPlrHandSeed

This function sets a new seed on a given item struct, not just the held item.

* Don't use HoldItem as a temporary for the players initial inventory

* Take Item by reference in RespawnItem

* Don't use holdItem as a temporary when dropping gold on death

* Update DeadItem to take item by reference, and refer to it consistently

Move code which invalidates the source of dropped items to the caller

Most call sites use a temporary item instance or remove the item from the container, so there's no real point invalidating the item after it's been copied to the drop list.

Update DeadItem to take position instead of player references
2022-03-06 14:53:29 +11:00
qndel 81800e64bb MAXCHARLEVEL cleanup 2022-03-01 21:45:47 +01:00
staphen 30a9595020 Fix Hork Demon and Nakrul drops in multiplayer 2022-02-04 18:44:26 +01:00
ephphatha eeb9ac3303 Sync dropped items if another player triggers an action on the current level 2022-01-24 21:12:13 +01:00
ephphatha db1d776539 Deduplicate PItem and DItem 2022-01-24 21:12:13 +01:00
staphen ca93d852d2 Fix comparison checking for invalid quest state in DeltaSyncJunk 2022-01-22 23:35:50 +01:00
obligaron 234a053863 Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
KPhoenix 34266ff4c7 Show correct death animation (#3953)
Shows death animation based on what armor you are wearing while dying. Dropping items on death results in showing light armor animation.
2022-01-15 20:24:19 +01:00
staphen 5b21e0188f Fix order of operations during game initialization 2022-01-15 06:47:09 +01:00
obligaron 35dc64312e Show preview CelSprite for player actions (Introduce PlayerStruct.pPreviewCelSprite and UpdatePreviewFrame) 2022-01-12 12:26:39 +01:00
KPhoenixandAnders Jenbo a08026097a Chat Interface Revision (#3840)
Co-authored-by: Anders Jenbo <[email protected]>
2021-12-25 10:11:42 +00:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
obligaron 635f378722 Add OptionEntry Experience Bar 2021-11-24 09:31:39 +01:00
ephphatha 18658f6a42 Remove duplicate argument to DeleteItem 2021-11-23 19:08:41 +01:00