Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/quests.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "engine/surface.hpp"
#include "levels/gendung.h"
#include "monster.h"
#include "panels/info_box.hpp"

Check warning on line 15 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:15:1 [misc-include-cleaner]

included header info_box.hpp is not used directly
#include "tables/objdat.h"
#include "tables/textdat.h"
#include "utils/attributes.h"
Expand All @@ -22,14 +22,15 @@
#define MAXQUESTS 24

/** States of the mushroom quest */
enum {

Check warning on line 25 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:25:1 [performance-enum-size]

enum '(unnamed enum at /home/runner/work/DevilutionX/DevilutionX/Source/quests.h:25:1)' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size
QS_INIT,

Check warning on line 26 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:26:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_INIT'
QS_TOMESPAWNED,

Check warning on line 27 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:27:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_TOMESPAWNED'
QS_TOMEGIVEN,

Check warning on line 28 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:28:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_TOMEGIVEN'
QS_MUSHSPAWNED,

Check warning on line 29 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:29:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_MUSHSPAWNED'
QS_MUSHPICKED,

Check warning on line 30 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:30:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_MUSHPICKED'
QS_MUSHGIVEN,

Check warning on line 31 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:31:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_MUSHGIVEN'
QS_BRAINSPAWNED,

Check warning on line 32 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:32:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_BRAINSPAWNED'
QS_ADRIATALKED,

Check warning on line 33 in Source/quests.h

View workflow job for this annotation

GitHub Actions / tidy-check

Source/quests.h:33:2 [readability-identifier-naming]

invalid case style for enum constant 'QS_ADRIATALKED'
QS_BRAINGIVEN,
};

Expand Down
3 changes: 2 additions & 1 deletion Source/towners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ void TalkToWitch(Player &player, Towner & /*witch*/)
}
}
if (Quests[Q_MUSHROOM]._qvar1 >= QS_MUSHGIVEN) {
if (HasInventoryItemWithId(player, IDI_BRAIN)) {
if (HasInventoryItemWithId(player, IDI_BRAIN) && Quests[Q_MUSHROOM]._qvar1 != QS_ADRIATALKED) {
Quests[Q_MUSHROOM]._qmsg = TEXT_MUSH11;
Quests[Q_MUSHROOM]._qvar1 = QS_ADRIATALKED;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_qvar1 gets stored in the save file so I think this enum should match the one in Devilution for the purposes of save compatibility. I feel like there must be another way.

https://github.com/diasurgical/devilution/blob/9f01757243412bb154d02d9af65c804159e6e0ea/enums.h#L3154-L3163

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the original logic is using _qvar2 for this. Seems like we should be doing that, also for save compatibility.

https://github.com/diasurgical/devilution/blob/9f01757243412bb154d02d9af65c804159e6e0ea/Source/towners.cpp#L1064

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch, I missed that was qvar2 in the original and not qvar1. I also got distracted by how tMsgSaid was removed in DevilutionX but is present in Devilution, though I couldn't find that being used anywhere.

This could be swapped to qvar2 and should work the same I think, and instead of using a QS_, we'd just store TEXT_MUSH11 and check for that like Devilution does.

NetSendCmdQuest(true, Quests[Q_MUSHROOM]);
InitQTextMsg(TEXT_MUSH11);
return;
Expand Down
Loading