Commit Graph

12525 Commits

Author SHA1 Message Date
Alex King 26eabcd7a4 [Cleanup] Explicitly cast to float for more precision in Bot::GenerateBastHitPoints() (#3238)
# Notes
- Not casting explicitly we lost precision.
2023-04-03 17:05:48 -04:00
Alex King 60091015d3 [Cleanup] Remove unnecessary >= 0 checks for procs in botspellsai.cpp (#3242)
# Notes
- These are always `>= 0` since they're `uint16`.
2023-04-03 17:05:03 -04:00
Alex King 470392021b [Cleanup] Remove unnecessary setting of spell_type_index in Bot::GetChanceToCastBySpellType() (#3243)
# Notes
- The default is already `SPELL_TYPE_COUNT`, no need to set it again.
2023-04-03 17:04:51 -04:00
Alex King 90984c3215 [Cleanup] Remove unnecessary spell_list validation check in botspellsai.cpp (#3244)
# Notes
- We check if valid above, no need to do it again.
2023-04-03 17:03:56 -04:00
Alex King da2296d416 [Cleanup] Remove unnecessary hpr checks in Bot::BotCastHeal() (#3245)
# Notes
- These checks are unnecessary as we know it doesn't pass previous checks.
2023-04-03 17:03:36 -04:00
Alex King c9221f239c [Cleanup] Remove unnecessary botCaster check in Bot::GetDebuffBotSpell() (#3246)
# Notes
- We already check if `botCaster` is invalid above, no need to do so again.
2023-04-03 17:02:48 -04:00
Alex King f4edc69a87 [Cleanup] Cleanup unnecessary string -> char* -> string conversions in eqemu_config.cpp (#3207)
# Notes
- These conversions are unnecessary since we can just use the string itself.
2023-04-03 17:01:44 -04:00
Alex King 7d04608c4d [Cleanup] summon_count > MAX_SWARM_PETS is always false in aa.cpp (#3212)
# Notes
- This was always false.
2023-04-03 17:00:08 -04:00
Alex King 32be049d96 [Cleanup] Remove extraneous loottable_id setting in WakeTheDead in aa.cpp (#3215)
# Notes
- We already set `made_npc->loottable_id` to `0` above.
2023-04-03 16:59:06 -04:00
Alex King 26fd52fb06 [Cleanup] Fix SEResist array settings duplicate code (#3225)
# Notes
- These conditions did the same thing, combining them is simpler.
2023-04-03 16:53:48 -04:00
Alex King 5dd849ac75 [Cleanup] Fix typo where itembonuses should have been used instead of spellbonuses (#3221)
# Notes
- `itembonuses` was the proper name here, not `spellbonuses`.
2023-04-03 16:51:22 -04:00
Alex King f484fe4176 [Cleanup] gid is assigned 2 values simultaneously in bot.cpp (#3234)
# Notes
- Unnecessarily assigning the value twice simultaneously.
2023-04-03 16:47:46 -04:00
Alex King 3d20c0d6aa [Cleanup] Change level to bot_level in Bot::DoClassAttacks() to not overlap member variable (#3239)
# Notes
- Member variable is named `level`, change variable to `bot_level` so we don't cause issues.
2023-04-03 16:47:31 -04:00
Alex King 0297045cc5 [Cleanup] Move cases in Bot::AICastSpell() (#3247)
# Notes
- These all returned `false`, no need to be separate.
2023-04-03 16:46:31 -04:00
Alex King cb90d00832 [Cleanup] Cleanup variable names in Bot::AddSpellToBotList() (#3248)
# Notes
- `max_hp` was named after a member variable.
2023-04-03 16:45:36 -04:00
Aeadoin f752b57a55 [Cleanup] Cleanup uses of insert/push_back when a temp object is used. (#3170) 2023-04-03 16:45:01 -04:00
Alex King 2bb15271c5 [Cleanup] Fix possible dereferencing of invalid iterator in constants (#3181)
# Notes
- Possible dereferencing of invalid iterator based on logic: https://pvs-studio.com/en/docs/warnings/v783/
2023-04-03 16:42:45 -04:00
Alex King 6976e27501 [Cleanup] Use a constant reference for content_flags in SetContentFlags() (#3196)
# Notes
- This is more performant.
- https://pvs-studio.com/en/docs/warnings/v813/
- https://pvs-studio.com/en/docs/warnings/v820/
2023-04-03 16:38:20 -04:00
Alex King c9f27d6f90 [Cleanup] Remove possible dereferenced nullptrs in bot.cpp (#3241)
# Notes
- Possible dereferenced nullptrs based on logic.
2023-04-03 16:30:46 -04:00
Alex King cb129efcad [Cleanup] Fix loop and code duplication for SE_ProcOnKillShot (#3224)
* [Cleanup] Fix loop for SE_ProcOnKillShot

# Notes
- We were doing `e = 3` instead of doing `e += 3`.

* Update bonuses.cpp
2023-04-03 16:28:15 -04:00
Aeadoin d653989b03 [Bug Fix] Fix issue with Bot Raid invites not working. (#3249)
* [Bug Fix] Fix issue with Bot Raid invites not always working.

* ordering
2023-04-03 16:28:05 -04:00
Alex King ea9b373180 [Cleanup] Further bot.cpp nullptr checks (#3240)
# Notes
- `nullptr` validation
2023-04-03 16:25:00 -04:00
Aeadoin a4e006fbfb [Bug Fix] Correct Forward Declaration compilation warning (#3176)
* [Bug Fix] Correct Forward Declaration compilation warning

* no need for include
2023-04-02 12:19:43 -04:00
Aeadoin 1ffdd4cb34 [Performance] Change to use Pass by reference where valid. (#3163)
* [Performance] Change to use Pass by reference where valid.

* typo
2023-04-01 22:55:40 -04:00
Aeadoin 7f7ba2e6c2 [Cleanup] Remove unused Includes under zone files (#3162) 2023-04-01 22:55:28 -04:00
Aeadoin 090086f50c [Release] 22.9.0 (#3174) v22.9.0 2023-04-01 14:27:52 -04:00
Alex King 407b003f7d [Cleanup] Add client pointer validation to Zone::GetClosestZonePoint() (#3173)
# Notes
- We were not validating pointer here, could cause issues.
2023-04-01 14:22:52 -04:00
Alex King b6d315d803 [Cleanup] Remove unnecessary validation check in Zone::ClearBlockedSpells() (#3172)
# Notes
- This is unnecessary, since `safe_delete_array` checks for validity.
2023-04-01 13:59:03 -04:00
Aeadoin 6927177291 [Fix] Correct SE_SlayUndead & SE_HeadShotLevel limit Value when applied. (#3171) 2023-04-01 13:31:13 -04:00
Aeadoin 31ede355a8 [Cleanup] Cleanup excessive type casting: string -> char * -> string (#3169)
* [Cleanup] Cleanup excessive type casting: string -> char * -> string

* [Cleanup] Cleanup excessive type casting: string -> char * -> string
2023-04-01 12:45:16 -04:00
Aeadoin 0df84e1ee6 [Crash] Fix out of bound arrays, other potential crashes (#3166) 2023-04-01 12:44:41 -04:00
Aeadoin 0d509a7f3a [Crash] Add Checks for valid pointers or fix existing. (#3164) 2023-04-01 12:44:00 -04:00
Aeadoin 4c2271ff69 [Fix] Prevent VerifyGroup from setting OOZ membername to Null character. (#3168) 2023-04-01 12:40:55 -04:00
Aeadoin ca2072e7bf [Bots] Remove Bot Groups Functionality (#3165)
* [Bots] Remove Bot Groups Functionality

* in-class initializers for member variables.
2023-03-31 21:37:52 -04:00
Alex King e1eb1ff738 [Quest API] Add missing Luabind definitions to lua_general.cpp (#3167)
# Notes
- These definitions were missing somehow.
2023-03-31 21:05:01 -04:00
Aeadoin 25f5898bae [Release] 22.8.2 (#3161) v22.8.2 2023-03-30 09:22:58 -04:00
Aeadoin 934ff3dadf [Bug Fix] Correct logic checks for Bot rule AllowOwnerOptionAltCombat (#3158)
* [Bug Fix] Correct logic checks for Bot rule AllowOwnerOptionAltCombat

* fix ordering of raid/group checks
2023-03-30 08:31:57 -04:00
Aeadoin e4ff76dceb [Bug Fix] Fix for OOZ Group updates when removing/inviting Bots (#3159)
* [Bug Fix] Fix for Cross Zone Group updates with Bots when disbanding/joining groups.

* check for nullptr
2023-03-30 08:31:50 -04:00
Alex King 6960a1a682 [Bug Fix] Fix issues with Lua tables not starting at index 1 (#3160)
* [Bug Fix] Fix issues with Lua tables not starting at index 1

# Notes
- This would cause the first item in the table to be inaccessible since Lua tables start at index `1` instead of index `0`.
- All other spots using Lua tables have their indexes starting at `1`.

* Update lua_general.cpp
2023-03-30 06:02:53 -04:00
Aeadoin d4174ca236 [Fix] Fix strcpy-param-overlap (#3157) 2023-03-29 08:33:06 -04:00
Aeadoin 7854130a93 [Bug Fix] Check Rule "Bots Enabled" to prevent bot database calls on connect (#3154)
* [Bug Fix] Check for Rule "Bots Enabled" to prevent bot database calls if not enabled.

* formatting

* check if LoadBotsList failed, or is bots_list empty
2023-03-28 22:44:47 -04:00
Alex King e9c63c7d94 [Rules] Remove Guild Bank Zone ID Rule (#3156)
# notes
- This rule is useless as guild bank zone ID is hard-coded into the client.
2023-03-28 21:58:58 -04:00
Aeadoin 27e0665aae [Bug Fix] Fix bot_raid_members.sql for MYSQL. (#3155) 2023-03-28 15:25:16 -04:00
Alex King ea2f431fce [Fix] Fix an issue with EVENT_DISCONNECT not firing on regular /camp (#3153)
* [Fix] Fix an issue with EVENT_DISCONNECT not firing on regular /camp

# Notes
- We were only sending `EVENT_DISCONNECT` on GM instant camps or linkdeads.

* Update client_process.cpp
2023-03-27 21:45:02 -04:00
Aeadoin 8bdcf7cb94 [Crash] Add Checks for out of bounds & dereferencing nullptrs (#3151)
* [Crash] Add Checks for out of bounds/nullptr dereferences

* formatting

* formatting

* formatting

* Update bot.cpp

---------

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
2023-03-27 21:43:46 -04:00
Aeadoin 87cb74b851 [Release] 22.8.1 (#3152) v22.8.1 2023-03-27 17:55:48 -04:00
Alex King 26c267db1b [Cleanup] "equipped" not "equiped", "dual" not "duel". (#3149)
* [Cleanup] "equipped" not "equiped", "dual" not "duel".

# Notes
- These are spelled incorrectly.

* Update spdat.h

* Formatting further.

* Update api_service.cpp
2023-03-27 17:55:37 -04:00
Aeadoin 99f8e6cef5 [Bug Fix] Fix for NPCs having spells interrupted. (#3150) 2023-03-27 16:57:08 -04:00
Aeadoin b6917ec782 [Release] 22.8.0 (#3148) v22.8.0 2023-03-25 20:48:43 -04:00
Aeadoin eb51550109 [Cleanup] Cleanup Strings::ToInt uses. (#3142)
* [Cleanup] Cleanup Strings::ToInt uses.

* fix for conversion

* remove != 0

* cleanup
2023-03-25 20:32:30 -04:00