Commit graph

41 commits

Author SHA1 Message Date
turleypol
f526ef17bd
Boat refactor Part 3 of N (#656)
* refactored boat move, fixed truncation of position when switching realm.
more simplifications
added more tests

* move_multi now accepts oldlocation like the other move functions

* added corechanges
2024-07-10 19:54:31 +02:00
turleypol
b216a16d36
refactored npcmod,decay to use Pos classes, removed all wrappers from Realm (#652)
* refactored npcmod,decay to use Pos classes
get rid of some realm methods used to wrap Pos

* all wrappers in Realm are now gone

* review comments
2024-07-07 15:32:29 +02:00
turleypol
a88d76acc3
refactor uomod to use pos classes (#651)
* refactor uomod to use pos classes

* fixed ambiguous call
2024-07-06 07:56:02 +02:00
Kevin Eady
e5209a51ff
Add support for boat piloting via mouse movement (#558)
* Initial work on boat piloting changes
- Changed: Boat script is now registered as the boat's control script
- Added: Boat piloting via mouse movement
- Added: boatRef.pilot member
- Added: boatRef.pilot([charRef]) method

* add first test

* Fix boat control script attach on scripted create

* move boat move packet warnings to suspicious acts

* set pilot now errors when mutli has no process

* Add test, testclient support for boat move packet

* Touchup pilot members and methods
- Change `pilot` method to `setpilot`. This standarizes it a bit with
the same naming convention of `npc.setmaster`.
- Fix return values in `pilot` member, returning `0` if no pilot.

* Refactor to put functionality inside UBoat

* Address Discord comments
- Remove SuspecisionActs for no boat process.
- Add `relative_direction` to boat move sysevent.

* destroy boatmount on chr death; more error checks

* Fix compilation after master merge

* Fix relative_direction calculation

* wip tests

* Fix boat tests

* Address review comments
- Initialize UBoat::mountpiece

* Add HSA check to boat.setpilot

* Reject movement if boat mountpiece equipped

* docs; test cleanup

* add test for blocked movement

* Address Discord review comments
- Add suspicious acts notice for client movement while piloting
- Return error on attempting to script move a char that is piloting a boat

* Fix compiler warning
2024-01-06 18:01:31 +07:00
turleypol
d873551c25
removed pol_distance/inrange* functions (#556)
* removed pol_distance/inrange* functions
replaced lastxyz with Pos4d

* replaced WorldIterator::InVisualRange with InMaxVisualRange returning
all objects in maximum update range. Adapted each caller, they now have
to check in_visual_range
Multis should now be send to clients with its footprint in mind.
added testscript for boat moving in/out of range

* removed non pos InRange/InBox functions
gamestate.update_range doesnt need to be a Vector, renamed

* corrected send_action_to_inrange

* replaced clip methods with general numeric type clamp function

* added Range2d constructor with radius

* splitted update_range. chr has now a los_size (how far can it see) and
an object has a visible_size (0 for objects 1/2 footprint for multis)

* use in_range instead of pol_distance

* corrected order of checks

* fixed warnings

* fixed visual size of multis
testclient added wornitems pkt support
added tests for los

* corechanges
2023-12-25 22:02:52 +01:00
AsYlum-
6f0db1810a
Fix crash related to item position. (#502) 2023-01-20 07:15:14 +01:00
turleypol
eeb57d489a
Drop/getitem related pos refactoring (#497)
* refactored move_item

* container location methods

* dropitem position refactors

* addressed pr comments.
fixed comment
more readable algo for random location
2023-01-05 00:10:51 +01:00
turleypol
99667711af
Fixed move of mobiles/items between realms (#446)
* MoveObject fix between realms for mobiles and items

* missing poltool changes
2021-12-15 07:47:54 +01:00
turleypol
7ee1b64e19
replaced baseclass x,y,z,realm members with Pos4d. (#420)
* replaced baseclass x,y,z,realm members with Pos4d.
Adapted the code, no changes except making the compiler happy

* review changes

* Fixed gotten_item

* fixed copy&waste
2021-09-10 20:17:25 +02:00
Fernando Rozenblit
c49f5b4abb
Reorganize regions and realms (#228)
* Moved realms.h and realms.cpp to realms/..

* Moved regions into their own folder
2020-08-17 22:29:07 +02:00
Kevin Eady
12d6186d10
Script option enhancements (#118)
* Fix SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES

* Add SCRIPTOPT_SURVIVE_ATTACHED_DISCONNECT

* wip beginning work on templatization

* Use PolModule in pol-specific modules

* wip, creating PolModule with getXYZParam

* wip 1, moving getXYZ to UOExecutor

* compilable with PolObjectImp / PolApplicObj

* add type guard

* wip, change signatures

change signatures of script_method, script_method_id, and
custom_script_method

* compilable (windows)

* linux fixes

* namespace fixes

* remove uoexhelp

* formatting

* compilable

- move can_access_offline_mobiles back to uoexec
- add guildscrobj and partyscrobj sources
- move EGuildRefObjImp and EPartyRefObjImp
- wip, implement asUOExec
- formatting uoexec.cpp,.h

* finish uoexec() helper

* some cleanup
2020-02-08 09:21:35 +01:00
turleypol
25dae4fc21 fixed namespaces of moved files 2018-12-22 00:32:47 +01:00
turleypol
e1b14dcd00 moved polfile/uofile files into plib to cleanup atleast a bit the
compile dependencies
2018-12-21 20:27:05 +01:00
esdete
dc2d29b433 NULL to nullptr 2018-07-31 14:30:29 +02:00
Fernando Rozenblit
02b966d64d Refactoring to make adding entered/leftarea events to items easier 2018-06-17 17:08:00 +02:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turleypol
798eda5b63 Cleanup of header includes. 2018-01-01 21:52:14 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
Gabriele Tozzi
d1ac902926 Documentation: reformatted headers for DoxyGen 2016-01-28 14:52:40 +01:00
turley
dfd65e30cd Moved plib realm to pol 2015-09-18 19:11:46 +02:00
turley
e8b46466fa Simplified WorldIterator more
completely removed wrldsize header
simplified more headers
changed zone_convert* parameter from non-const reference to pointer, to make the caller clear that it will change.
2015-01-03 10:15:31 +01:00
turley
122f8fd25f Cleanup of Remove Object pkt
Added override and final makro
2014-11-22 12:28:15 +01:00
turley
dd4d4c0f9a Added new WorldIteratorFilter for active client only players
Fixed warning during pkt write of sound effects.
2014-11-21 21:28:09 +01:00
frozenblit
46266a73f3 Fixed shadow realm crash + improvements
Added option "ShowRealmInfo" to spam the console with information about
realms in pol.cfg

Added number of offline mobiles and multis to the information from
polsys::Realms()

Added new method ListOfflineMobilesInRealm() in uo.em.

Encapsulated the Realm counts to be sure no one's changing them from the
outside.

Added missing core-changes entry ;)
2014-11-05 22:45:35 +01:00
frozenblit
1f0f7581dd Some more cleanups 2014-11-03 01:29:21 +01:00
turley
b2572d69f7 fixed size estimation. MoveObjectToLocation on a boat now unregisteres the boat first thus small changes are also possible. 2014-07-05 09:40:15 +00:00
dsourc
71e68bd9c4 Fixed: using DestroyItem or SubtractAmount on an item 'gotten' it will now first release the item and then destroy it
Fixed:    NPCs looks for players for enter/leftarea events when, these were only looking for npcs 
            - moved with MoveObjectToLocation function
            - on every move
            - unhide
            - npc creation
  Fixed:    Destroying an equipped item now calls unequip scripts
2014-06-07 11:31:02 +00:00
turley
fb873de803 decoupled headers to optimize a bit the build time 2014-05-03 09:06:19 +00:00
turley
261052f48d cleanup of the world iteration methods 2014-01-19 15:25:48 +00:00
turley
47fec4bdf5 splitted world zones into players and npcs, added several helper functions to only interate over the wanted types (player+npcs,player,npc,items,multis) best usable with lambdas. 2013-12-31 14:14:04 +00:00
turley
99d7dc3037 namespaces...finally :)
Hard part is finished every file is touched. Namespaces are currently rough named by directory name.
Maybe we could split it more
2013-12-21 09:10:46 +00:00
turley
4765f1f0ec some small improvements:
movement code speedup: instead of storing new Mapshape simply store pointers 
reordered some class/structs (data alignment)
Mutex class freebsd compatible
mdump: invalid scope for pointer
some Constructor member reorders for linux
some unsigned < 0 checks removed
some nullpointer checks added
CallOutgoingPacketExportedFunction splitted into critical and noncritical part
npcs now use there boost for movement checks
2011-12-22 19:09:10 +00:00
turley
e10cd27cea sync: shini - long to int (prerequisit for 64-bit) 2010-03-29 14:52:03 +00:00
turley
9dd4b57445 boat doesnt send remove pkt if moving out of updaterange 2010-02-18 08:56:19 +00:00
turley
a569499434 chr->movemode instead of fixed land movemode 2009-12-08 08:34:37 +00:00
turley
34a913cd68 fix of remove_objects_inrange() call 2009-10-08 13:55:40 +00:00
muaddib_pol
7e09fb1f39 + More House Multi registration code 2009-09-16 03:51:38 +00:00
muaddib_pol
598004f9e6 + Registration of players and some npc instances, for when walking onto Houses. Leading up to Multi Walk-on support 2009-09-15 19:50:58 +00:00
turley
2e39309bf1 coordinate vartype cleanup, i hope no new bugs :( 2009-09-10 12:24:52 +00:00
muaddib_pol
bfa849cdc1 + UO Module code moved 2009-09-07 18:27:08 +00:00
Renamed from pol-core/pol/uoemod4.cpp (Browse further)