Anders Jenbo
a0949b98fc
asd
4 years ago
Anders Jenbo
d82f2ebc9e
Pass players by reference instead of an index
4 years ago
Anders Jenbo
72656b3011
Move path and palette to the engine folder
4 years ago
ephphatha
3af11ad355
Use the same function when checking and actually dropping an item
4 years ago
Gleb Mazovetskiy
9b72565bb0
Fix `RemoveBeltItemById`
4 years ago
Gleb Mazovetskiy
c45170d20e
Rename `inv_iterators` methods to `camelCase`
...
Per clang-tidy config
4 years ago
Gleb Mazovetskiy
628406a44c
Refactor inventory/belt item presence and removal
...
Introduces new functions to check for presence of and remove player items.
These functions do not rely on or expose item indices.
They're implemented as free functions instead of Player methods due to
complicated include dependencies between `player.h`, `inv.h`, and
`inv_iterators.h`. We should probably look into cleaning this up at some
point.
4 years ago
ephphatha
0cfd0e194a
Refactor TryDropItem to reduce use of globals
...
The way TryInvPut and DropItemBeforeTrig interacted was fragile, don't think this would've worked as expected at the best of times. Looks like it was added as part of controller support so guessing this isn't vanilla behaviour anyway.
4 years ago
ephphatha
ad7ad46ce9
Explicitly clear HoldItem when putting an item into the Inventory/Stash
...
Previously this also relied on NewCursor modifying MyPlayer->HoldItem when setting the cursor to a non-item cursor to avoid item duplication, seems more appropriate to make this explicit in the caller.
4 years ago
ephphatha
28b6eaf7de
Only use HoldItem in InvGetItem if necessary
...
When auto-placing gold in the inventory there's no need to trample HoldItem.
4 years ago
staphen
d16c2f0086
Avoid recreating items in PutItem locally
4 years ago
staphen
cf41911417
Use appropriate spell ID when quick casting from scroll or staff
4 years ago
staphen
33338115f6
Don't use HoldItem in CMD_PUTITEM handler
4 years ago
staphen
6a30cd3950
Add gamepad support for stash
4 years ago
staphen
822a0cd22a
Fix auto-equip network messages
4 years ago
Anders Jenbo
1ba817ca53
Unify gold handling (withdraw any amount from stash)
4 years ago
Andrew James
4ff83431d2
Remove the use of HoldItem in AutoGetItem ( #4178 )
4 years ago
obligaron
05658de4e9
Make GetInventorySize public
4 years ago
Anders Jenbo
a48f89007d
Implement stash
4 years ago
ephphatha
f5da32a21c
Don't assume holdItem when auto-placing gold
4 years ago
ephphatha
eeb9ac3303
Sync dropped items if another player triggers an action on the current level
4 years ago
ephphatha
c4c664c6be
Add class to allow iterating over all points in a rectangle
...
Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
4 years ago
Gleb Mazovetskiy
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 <anders@jenbo.dk>
4 years ago
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.
4 years ago
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.
4 years ago
Bernd Stellwag
f1a0aa3b49
Replace broken link with @see annotation to text representation of the linked image
4 years ago
Anders Jenbo
31ba8e2bc6
Validate additional network messages
5 years ago
Yuri Pourre
b8450dc792
Assign ctrl to drop items
5 years ago
BC Ko
51f50570da
documentation cleanup : inv
5 years ago
Juliano Leal Goncalves
bb2dfdfb73
🚚 Rename 'ItemStruct' to 'Item'
5 years ago
Juliano Leal Goncalves
bbf529c65a
🚚 Rename 'PlayerStruct' to 'Player'
5 years ago
Anders Jenbo
4044fadeb5
Clean up some players references
5 years ago
Gleb Mazovetskiy
032eaf7491
External iterators for player items
...
Implements external iterators for player items.
5 years ago
Robin
62a33c61d9
objects: deduplicate logic in OperateShrineGloomy using ForEachItem function
5 years ago
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues
5 years ago
Anders Jenbo
a19e7b2a3b
Remove some more use of miniwin
5 years ago
Anders Jenbo
4eabc6024b
Apply various cleanups via Android Studio
5 years ago
Gleb Mazovetskiy
cb0dae8590
🚚 Rename `CelOutputBuf` to `Surface` and extract
5 years ago
qndel
fd3893190f
inv cleanup
5 years ago
Anders Jenbo
ee7b32d8f6
Player by reference part 3
5 years ago
Anders Jenbo
e670faac99
🔥 Remove unused code DrawInvMsg
5 years ago
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract `Point`, `Direction`, `clamp`
...
`engine.h` is getting quite bloated. Moves this code to their own files.
5 years ago
Juliano Leal Goncalves
07a049f667
♻️ Replace 'INV_SLOT_SIZE_PX' macro with Size-based constexpr
5 years ago
Juliano Leal Goncalves
ff3dee8d45
♻️ Replace poor usages of 'Size' with 'Point's
5 years ago
Juliano Leal Goncalves
58501cab26
🚚 Move 'Size' struct to engine.h
5 years ago
Juliano Leal Goncalves
abee4fe6fe
♻️ Repurpose the 'InvXY' struct as a new 'Size' struct
5 years ago
Juliano Leal Goncalves
21ecaa225f
♻️ Leverage 'Point' struct on inventory functions ( #2094 )
5 years ago
Anders Jenbo
8a7ec56d3a
Player by reference part 2
...
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
5 years ago
Anders Jenbo
6ce8f13751
Apply clang-tidy to more code and do some related cleanups
5 years ago
Anders Jenbo
0c2042fa52
♻️ Player by reference
...
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd
ads
as
5 years ago