1
0
Fork 0
Commit Graph

34 Commits

Author SHA1 Message Date
Tiger Wang 6e80f7544d Update entity sizes 2021-04-12 22:35:07 +01:00
Tiger Wang 16aeb84cd3
Fix potential destruction crashes (#5095)
* Fix potential destruction crashes

* Fix destructors accessing destroyted objects
* Fix cPlayer not destroying windows (Destroyed never called)
* Tentatively fixes #4608, fixes #3236, fixes #3262
- Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld()

* Add missing call to OnRemoveFromWorld
2021-01-02 13:50:34 +00:00
Tiger Wang 47c0b48bfd Monsters: improve targeting
* Replace DoWithNearestPlayer with bounding box search (avoid iterating through all players in world).
* Do line-of-sight checks from eye-to-eye.
+ Added LOS and LOS lost timer to target lost checks, in addition to distance.
2020-12-21 13:52:23 +00:00
12xx12 32ee1708a2
Adding wolf breading and moving breeding functionality to cMonster (#4951)
* added wolf breading

* mpoved breeding to monster

* checkstyle

* fixed my IDE "helping"

* removed magic number
and fixed faster aging

* added flooring to age manipulation

* fixed copiler error

* fixed typo

* moved tps to Defines.h

* removed the TPS constant from the lua API exposure

* added inline constexpr
added explanation

* fixed broken build

* "fixed" build

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-09 20:49:25 +00:00
12xx12 c2f8ceb554
Add more statistic tracking (#4837)
+ Added possible 1.8 stats
+ Added stat tracking for 1.8.2
+ Added stat tracking for 1.9
+ Added the breed cow achievement

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-09-05 16:13:44 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* Avoid inefficient AString -> c_str() -> AString round trip

* Avoid redundant string init expressions

* Avoid unnecessary return, continue, etc.

* Add .clang-format to help with clang-tidy fix-its

* Avoid unnecessary passing by value

* Avoid unnecessary local copying

* Avoid copying in range-for loops

* Avoid over-complicated boolean expressions

* Some violations missed by my local clang-tidy

* Allow unnecessary continue statements

* Add brackets

* Another expression missed locally

* Move BindingsProcessor call into clang-tidy.sh and add space

* Fix pushd not found error

* Different grouping of CheckBlockInteractionRate
2020-05-14 22:15:35 +00:00
Mattes D 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Mat 9ddf433ae7
Add ambient mob sounds (#4521) 2020-03-22 15:50:34 +00:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
changyong guo 57690b81a2 Experience orb (#4259)
* Replace cWorld::FindClosesPlayer with cWorld::DoWithClosestPlayer
* Implement experience reward splitting into the orb sizes used in vanilla
* Modified speed calculation in cExpOrb::Tick to make the orbs fly towards the player

Fixes #4216
2018-08-02 15:59:10 +01:00
peterbell10 e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
LogicParrot 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
Bond-009 6a19841121 Added basic ocelot behavior (#3829) 2017-07-12 12:42:02 +02:00
Bond_009 445abe001a When right-clicking on a passive mob with 'his' spawn egg spawn a baby 2017-07-02 07:38:41 +02:00
peterbell10 360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
LogicParrot 90be4e7efd Entities now bail out of ticks if destroyed (#3363) 2016-09-03 14:31:27 +03:00
LogicParrot a3d9bd8ba0 Fix passive mob destruction crashes 2016-03-28 18:37:43 +03:00
LogicParrot 83459d0d89 Proper entity destruction in non-ticking chunks 2016-02-19 07:05:22 +02:00
LogicParrot 6661e5d27f Prevent interspecies breeding 2016-02-04 20:44:55 +02:00
Gargaj 0eb519b35a sheep color inheritance 2015-12-13 13:04:18 +01:00
Safwat Halaby dbda48ead4 Added documentation for breeding code 2015-11-30 12:05:38 +02:00
Gargaj 4ae3b64b07 implement breeding 2015-11-29 20:14:28 +01:00
Gargaj 853e6e6882 change from single followable item to multiple 2015-11-23 22:20:31 +01:00
tycho dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
Tycho 2a9664d6ca Initial convertion of a_Dt to std::chrono
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2015-01-11 21:12:26 +00:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Tycho 6e7c0e33b5 Added first test to show the object can be created 2014-09-17 18:40:10 +01:00
Howaner 7e76f030aa Add entity invulnerable 2014-04-26 00:32:30 +02:00
tonibm19 e9c1d1ea9c Did what xoft said 2014-01-29 20:02:41 +01:00
tonibm19 1c1832b6ce Rewritten code.
Implemented xoft suggestion.
Using MoveToPosition as tigerw suggested.
2014-01-29 19:15:26 +01:00
Tiger Wang 9c0e3615ce Large reworking of mob code [SEE DESC]
+ Implemented better pathfinding
- Removed lots of unused variables, functions, etc.
* Changed some variable types
* Other miscellaneous fixes, and also completes the previous PRs
2014-01-24 19:57:32 +00:00
Alexander Harkness 675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00