Commit graph

123 commits

Author SHA1 Message Date
Ramon Bernardo
afd9165725
refactor(thing): remove Cylinder class and merge receiver logic into Thing (#5058)
* refactor(cylinder): remove Cylinder class and merge receiver logic into Thing

* fix(game): code format

* fix(trashholder): code format

* refactor(thing): remove unused params

* refactor: remove unused params

* fix(luascript): use default switch case

* fix(item): parent nullptr check

* refactor(creature): use tile property instead getTile method

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>

* refactor(item): getTile method on get parent

* refactor(player): simplify query destination logic

* refactor(container): simplify query destination logic

* refactor(item): use const parent var

* fix(luascript): support move removed item

* fix(game): rename thing param

* fix(player): destThing nullptr check

* fix(thing): remove startDecaying method

* fix(container): merge master branch

* fix(depotchest): merge master branch

* refactor(container): remove unnecessary if state on top-parent

---------

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2025-11-29 01:38:42 +01:00
Ramon Bernardo
f849a53294
refactor(tile): unify house tile access and checks with removing dynamic cast (#5054)
Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2025-11-19 08:58:14 +01:00
Ramon Bernardo
66031bc5fe
refactor(core): move description method from Thing to Creature and remove unused overrides (#5052) 2025-11-17 00:32:08 +01:00
Ramon Bernardo
e34d4fa76e
fix(tile): ensure alwaysOnTop items are inserted above existing items with same order (#5036) 2025-11-15 04:21:14 +01:00
Ramon Bernardo
80048f5dd0
refactor(tile): remove redundant tile update method and move inside notification method (#5026)
* refactor(cylinder): remove redundant tile update method and simplify notify logic

* fix(cylinder): handle tile update only in Tile instead Player

* fix(tile): use inline constexpr for TILE_UPDATE_THRESHOLD

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>

---------

Co-authored-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2025-11-11 18:10:44 +01:00
Ramon Bernardo
31ca7514d0
refactor(tile): remove unused onAddTileItem method (#5028) 2025-11-08 23:14:43 +01:00
Artur Knopik Linux
5bfda8f613 Revert "[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc system) (#4671)"
This reverts commit 4a89502f46.
2024-12-05 23:56:16 +01:00
Ramon Bernardo
427f32a73d
Add a new method to check if Thing has a parent (#4810) 2024-10-22 14:31:04 -03:00
KrecikOnDexin
b99b9fda05
Fix usage items under player (#4758)
* fix usage items under player

* Zbizu update

* Revert "Zbizu update"

This reverts commit fa16c68d57.

* update
2024-10-06 20:03:08 +02:00
Mario
4a89502f46
[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc system) (#4671)
Co-authored-by: Sarah Wesker <sarahelizabetwesker@gmail.com>
2024-05-30 02:55:42 +02:00
Ranieri Althoff
73032fa7d4
Move config manager singleton to namespace (#4653) 2024-04-27 00:48:25 -03:00
Sarah Wesker
a4471edb3a
onStepOut FIXED (#4650) 2024-04-12 20:53:22 -06:00
Ramon Bernardo
2946e9e4c4
Replace hardcoded values with MAX_STACKPOS (#4565) 2023-11-21 20:08:41 -03:00
Marco Oliveira
545516299b
Update copyright year (#4331) 2023-02-18 20:10:02 -03:00
Marcin Jałocha
70df6acbc0
Fix login into field issue (#4285) 2023-01-07 10:47:42 +01:00
Ramon Bernardo
4bd81f3351
Replace unchecked virtual functions with static_cast (#4060) 2022-11-10 21:56:22 +01:00
Marcin Jałocha
8a0fe3fb07
Field pathfinding (#4229)
* Update map.cpp

* Update tile.cpp

* Fix hasBitSet

* Update tile.cpp
2022-11-01 09:01:56 +01:00
Ranieri Althoff
412950218c
Add code formatting with clang-format (#4029)
- Use base Google style
- Drop column limit override
- Format all files
- Use tabs for indentation
- Move system headers after project headers
- Avoid breaking string literals
- Reflow usage text
- Match breaks before braces and colons to previous style
- Reduce spaces before trailing comments
- Reflow comments and fix macro usage in luascript.cpp
- Fix invalid code
- Don't align newline escapes
- Reflow comment to make more sense
2022-04-13 14:06:08 +00:00
Ranieri Althoff
c3596491a3
Cleanup & organize includes and PCH (#4019) 2022-03-18 16:20:02 -04:00
Evil Puncker
2f8a2afb3b
Add AUTHORS file and remade source header (#3969) 2022-02-22 19:41:21 +01:00
Ramon Bernardo
a4c988290a
Use TFS code style on comparison and boolean check (#3725) 2021-10-31 12:28:02 -04:00
Ramon Bernardo
d057d517ab
Replace boost::adaptors::reverse with std::vector::reverse (#3738) 2021-10-23 01:56:39 -03:00
Marcin Michalski
e1feac29b0
Add ghost mode check to Creature.canSeeCreature (#3595) 2021-08-25 08:33:00 -04:00
Kamenuvol
7cc6856a5a
Fix browse field items parent being not the browse field (#3440) 2021-05-06 14:09:22 +02:00
Michał "Gubihe
8404edeff8
removed several unnecessary whitespaces from files (#3375) 2021-03-25 11:13:43 -03:00
slavi
3c6f936eff
Fix stacking creatures in a tile (#2673) 2021-01-24 16:44:36 -05:00
nekiro
1f1c490fe8
New store inbox implementation (#3186)
New item class methods:
item:isStoreItem()
item:setStoreItem(bool storeItem)

New ItemType class methods:
itemType:isStoreItem()

New items.xml item type attribute
key="storeitem" value="true"
2020-10-22 11:53:39 +02:00
nekiro
6478e1a9f7
New option to prevent removing items from house if player is not invited (#3159)
config.lua:
onlyInvitedCanMoveHouseItems = true
2020-10-18 17:46:09 -04:00
Sam
7357e91edc
Fix crash related to map cleaning (#3182) 2020-10-17 13:50:20 +02:00
Mario
db4e8cc1fb
Optimized Clean with optional Protection Zone Clean (#2647)
A new vector now holds all tiles that would have to be cleaned.
This avoids iterating over the whole map at clean-time.
Cleaning protection zones is optional with a cleanProtectionZones config setting.

Co-authored-by: Sarah Wesker <millhiorebt@users.noreply.github.com>
Co-authored-by: Znote <stefan_brannfjell@live.no>
2020-06-14 19:10:57 -04:00
WibbenZ
08231f4239
Remove trailing spaces (#2854)
* Remove trailing spaces

Removed trailing spaces and added spaces to some XML tags
Removed else statment from sweetheart_ring.lua

* Remove variable from sweetheart_ring.lua
2020-03-19 05:27:04 +01:00
Mark Samman
2f802cb23e Use a vector for spectators in getSpectators and filter out duplicates manually where necessary 2019-11-07 00:22:32 -05:00
Mark Samman
4844670118 Improve players spectator cache hit rate (#2694)
Only clear it when a player is added/moved/removed
2019-10-30 10:00:44 -04:00
Lucas CP
b7ef46dfc7 Update copyright for 2019 (#2590) 2019-05-13 14:22:45 +02:00
Sam
995933cd62
Revert "fixes wrong position (#2587)" (#2588)
This reverts commit 3348695df3.
2019-05-12 01:23:17 +02:00
Mario Tettei
3348695df3 fixes wrong position (#2587)
- Fixes wrong position from onStepOut Fix #2586
2019-05-11 23:30:23 +02:00
vankk
020ed5fd36 Update copyright for 2018 (#2452) 2018-03-05 00:39:47 +01:00
Marcin
5ccfce5e28 Fixing getting useItem (#2393)
* Fixing getting useItem

* Pass by value instead of reference.
2017-12-27 15:39:45 +01:00
Mkalo
18fbfdc33a Fix monsters walking over fields. (#2207)
Monsters' definition now includes 3 XML attributes that default to true: canwalkonenergy, canwalkonfire and canwalkonpoison.
Monsters that can't go through a certain field type will not step on it while random stepping (in combat but not able to reach target).
Based on results found in https://otland.net/threads/monsters-walking-around-fields-behaviour.245685/
2017-12-24 02:47:38 +01:00
Ranieri Althoff
4dbcf8df6a Reduce indentation levels by early exit (#2256) 2017-06-01 01:14:57 -03:00
Ranieri Althoff
6c6c25c00f Revert "onStep callback return value matter" (#2068) 2017-01-08 15:45:17 -02:00
Gustavo Aguiar
736b1bbeb8 onStep callback return value matter (#2049)
* Revert temporary fix to #1621

* onStep callback accept return value

* Code changes

Simplify if
Use position instead of lookPosition alias

* Ignore onStepOut return value when using Creature.teleportTo

* onStep default return value
2017-01-07 20:59:27 -02:00
Bruno Minervino
cc8e15e916 Update copyright year for 2017 (#2034) 2017-01-01 15:39:31 +01:00
Ranieri Althoff
80f6ebdd8c Assorted code improvements (#2042)
* General code improvements and consistency fixes
- Move static functions out of header if possible
- Replace typedef with using everywhere

* Standardize class and variable names
2016-12-30 14:02:17 +01:00
Ranieri Althoff
dd521db174 Use changes proposed by clang-tidy (#1879)
- Modernize constructors with pass-by-value + move
- Modernize loops to use new range-based loops
- Use auto where it improves code readability and maintainability
2016-10-02 23:52:01 +02:00
Mark Samman
6360f6caa0 Fix #1621 (#1932)
Reverts part of 2550261c20
2016-10-01 14:36:13 -05:00
Mark Samman
70590833b2 Optimizations and cleanups
This commit fixes #1448, removes some unused tile flags, and removes
support for "southex"/"eastex" in items.xml (use "southalt"/"eastalt").
2016-01-22 22:41:54 +01:00
Ranieri Althoff
8da8f0ea49 Remove unused imports 2016-01-15 02:33:57 -02:00
Mark Samman
23e9f46829 Update copyright year
Happy new year!
2016-01-01 02:07:18 +01:00
Damian Jarek
6d16178fd5 Remove boilerplate from TileItemVector
Use private inheritance instead of composition to reduce the
amount of boilerplate.
2015-12-20 23:56:56 +01:00