Commit Graph
376 Commits
Author SHA1 Message Date
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
ephphatha baa1cd65c5 Make FindGetItem return an index into ActiveItems
This allows the calling code in DeltaLoadLevel to behave the same as every other use of DeleteItem, making it possible to remove the duplicate argument and ensure that the ActiveItems/AvailableItems arrays are treated appropriately.
2021-11-23 19:08:41 +01:00
ephphatha 1d560601f2 Remove duplicated argument to InvGetItem
This was obscuring efforts to track how ActiveItems and Items are referenced, hopefully can switch back to the Item& soon.
2021-11-23 19:08:41 +01:00
Anders Jenbo da05319909 Correct OnNewLevel validation 2021-11-19 16:15:34 +01:00
ephphatha 87651aa2f5 Check the item at the target position before searching all items 2021-11-14 18:32:29 +01:00
Andrew James 8104432db4 Use object reference (and self-id lookup) for BreakBarrel 2021-11-08 00:51:16 +01:00
Andrew James 796e2813cf Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
Gleb Mazovetskiy 3d308983a8 Migrate to libmpq
libmpq is a much simpler alternative to StormLib for reading MPQ archives.

We use our own fork of libmpq: https://github.com/diasurgical/libmpq

Impact:

* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
  needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
2021-11-06 23:51:42 +00:00
qndel b00feb4c3d sync monster mWhoHit and hitpoints 2021-11-06 19:03:05 +01:00
Andrew James 021c7a652f Add helpers for checking object type (#3357)
* Add helper to test if an object is a trap source
* Add helper to test if an object is a barrel
* Add helper to test if an object is a crucifix
* Add helpers to check if an object is a chest (and statuses)
* Add helpers to check if an object is a (basic) shrine
2021-11-06 18:32:52 +01:00
Andrew James 7dcc6d15f7 Update some quest object activation functions to use references (#3356)
- rename with a hopefully more descriptive name
2021-11-01 15:48:54 +01:00
Anders Jenbo 96e1d5caba Fix spell properties incorrectly being capped at 8
Fixes  #3187
Revert #3021

destParam3 had been typed ad Direction, but is also sometimes used for
other values.
2021-10-25 20:52:56 +02:00
qndel d81de165d4 code cleanup (#3235) 2021-10-24 16:05:44 +02:00
Anders Jenbo b4f699f0a3 Validate item network messages 2021-10-12 04:56:30 +02:00
Anders Jenbo a56452eec3 Validate player sync 2021-10-12 04:56:30 +02:00
Andrew James e0aafcaf7d Use correct pointer arithmetic in OnLevelData (#3094)
Previously was incrementing the pointer 5 places due to the way pointers to complete objects are handled.

see https://en.cppreference.com/w/cpp/language/operator_arithmetic#Additive_operators
2021-10-11 11:02:45 +02:00
KPhoenix 2c8d29b10d Update msg.cpp
Fixes problem where you cannot cast spell on other players in the dungeon
2021-10-11 05:53:38 +02:00
Anders Jenbo 1024973093 Fix equipping weapon not updating current spell
Fixes #3074
2021-10-10 05:56:26 +02:00
Anders Jenbo 31ba8e2bc6 Validate additional network messages 2021-10-06 21:47:03 +02:00
obligaron 6b8b6ba77b Fix OnSpellTile check (#3021) 2021-10-06 08:35:59 +02:00
Anders Jenbo 5b3ac35fad Validate 2 more network messages 2021-10-05 10:46:03 +02:00
Anders Jenbo 403f507d79 Validate spell network messages 2021-10-04 19:22:34 +02:00
Anders Jenbo 614fba6af6 Cleanup package slicing 2021-10-04 19:22:34 +02:00
Anders Jenbo 2443a188a9 Validate param1 messages 2021-10-03 19:58:44 +02:00
Anders Jenbo ab1046072b Clean up NetSendCmdString 2021-10-03 19:58:44 +02:00
Anders Jenbo 58257c7cdc Remove unessesery null checks in multi_msg_add 2021-10-03 10:12:14 +02:00
Anders Jenbo d227ff33da Validat input to a few simple network messages 2021-10-02 20:30:16 +02:00
Anders Jenbo 7001ead263 Mark network pointers as const 2021-10-02 20:30:16 +02:00
Anders Jenbo 2708b16c05 Validate CMD_SYNCDATA (#2968) 2021-09-30 15:38:10 +02:00