Browse Source

Fix Monster Selection Loop and DAPI Griswold

Loop crashes (in debug build only somehow?) for selecting monster types when playing Diablo mode due to less monster types being available.

Fixes Griswold data not being sent client side due to extra blank entries in Towners struct.
pull/7983/head
NiteKat 11 months ago
parent
commit
c26aaddfab
  1. 4
      Source/dapi/Server.cpp
  2. 2
      Source/monster.cpp

4
Source/dapi/Server.cpp

@ -544,7 +544,7 @@ void Server::updateGameData()
data->groundItems.clear();
for (size_t i = 0; i < 4; i++) {
for (size_t i = 0; i < devilution::gbActivePlayers; i++) {
auto playerData = update->add_playerdata();
data->playerList[i].InvBody.clear();
@ -1057,7 +1057,7 @@ void Server::updateGameData()
townerData._ty = -1;
}
} else {
for (auto i = 0; i < NUM_TOWNERS; i++) {
for (auto i = 0; devilution::gbIsHellfire ? i < NUM_TOWNERS : i < 10; i++) {
auto townerID = data->townerList.size();
for (size_t j = 0; j < data->townerList.size(); j++) {
if (data->townerList[j]._ttype == devilution::Towners[i]._ttype) {

2
Source/monster.cpp

@ -3338,7 +3338,7 @@ tl::expected<void, std::string> GetLevelMTypes()
_monster_id typelist[MaxMonsters];
int nt = 0;
for (int i = MT_NZOMBIE; i < NUM_MTYPES; i++) {
for (int i = MT_NZOMBIE; i < MonstersData.size(); i++) {
if (!IsMonsterAvalible(MonstersData[i]))
continue;

Loading…
Cancel
Save