Misc changes.

The first two fixes were caught by infer. The Big Bug(tm) remains
unfixed.

* Fixed the Leech nano power
* Fixed an unlikely nullptr dereference in ItemManager
* /toggleai now makes mobs retreat immediately, instead of waiting for
their next movement tick
* Static path mobs will now stop in place instead of retreating to
their spawn points when AI is disabled
* Changed the misleading config option name from "chunksize" to
"viewdistance", since it's actually only a third of the chunk size
This commit is contained in:
2020-10-14 23:15:02 +02:00
parent 6ee5e6d1ae
commit 5784e77654
7 changed files with 26 additions and 13 deletions

View File

@@ -5,7 +5,7 @@
#include "NanoManager.hpp"
#include "Player.hpp"
#include <string.h> // for memset() and memcmp()
#include <string.h> // for memset()
#include <assert.h>
std::map<std::pair<int32_t, int32_t>, Item> ItemManager::ItemData;
@@ -911,6 +911,10 @@ void ItemManager::setItemStats(Player* plr) {
for (int i = 0; i < 4; i++) {
itemStatsDat = ItemManager::getItemData(plr->Equip[i].iID, plr->Equip[i].iType);
if (itemStatsDat == nullptr) {
std::cout << "[WARN] setItemStats(): getItemData() returned NULL" << std::endl;
continue;
}
plr->pointDamage += itemStatsDat->pointDamage;
plr->groupDamage += itemStatsDat->groupDamage;
plr->defense += itemStatsDat->defense;