Browse Source

🚚 Rename 'QuestStruct' to 'Quest'

pull/2783/head
Juliano Leal Goncalves 5 years ago committed by Anders Jenbo
parent
commit
0baffa6e33
  1. 2
      Source/msg.cpp
  2. 2
      Source/msg.h
  3. 6
      Source/quests.cpp
  4. 6
      Source/quests.h

2
Source/msg.cpp

@ -2276,7 +2276,7 @@ void NetSendCmdParam3(bool bHiPri, _cmd_id bCmd, uint16_t wParam1, uint16_t wPar
NetSendLoPri(MyPlayerId, (byte *)&cmd, sizeof(cmd)); NetSendLoPri(MyPlayerId, (byte *)&cmd, sizeof(cmd));
} }
void NetSendCmdQuest(bool bHiPri, const QuestStruct &quest) void NetSendCmdQuest(bool bHiPri, const Quest &quest)
{ {
TCmdQuest cmd; TCmdQuest cmd;
cmd.bCmd = CMD_SYNCQUEST; cmd.bCmd = CMD_SYNCQUEST;

2
Source/msg.h

@ -428,7 +428,7 @@ void NetSendCmdLocParam3(bool bHiPri, _cmd_id bCmd, Point position, uint16_t wPa
void NetSendCmdParam1(bool bHiPri, _cmd_id bCmd, uint16_t wParam1); void NetSendCmdParam1(bool bHiPri, _cmd_id bCmd, uint16_t wParam1);
void NetSendCmdParam2(bool bHiPri, _cmd_id bCmd, uint16_t wParam1, uint16_t wParam2); void NetSendCmdParam2(bool bHiPri, _cmd_id bCmd, uint16_t wParam1, uint16_t wParam2);
void NetSendCmdParam3(bool bHiPri, _cmd_id bCmd, uint16_t wParam1, uint16_t wParam2, uint16_t wParam3); void NetSendCmdParam3(bool bHiPri, _cmd_id bCmd, uint16_t wParam1, uint16_t wParam2, uint16_t wParam3);
void NetSendCmdQuest(bool bHiPri, const QuestStruct &quest); void NetSendCmdQuest(bool bHiPri, const Quest &quest);
void NetSendCmdGItem(bool bHiPri, _cmd_id bCmd, BYTE mast, BYTE pnum, BYTE ii); void NetSendCmdGItem(bool bHiPri, _cmd_id bCmd, BYTE mast, BYTE pnum, BYTE ii);
void NetSendCmdPItem(bool bHiPri, _cmd_id bCmd, Point position); void NetSendCmdPItem(bool bHiPri, _cmd_id bCmd, Point position);
void NetSendCmdChItem(bool bHiPri, BYTE bLoc); void NetSendCmdChItem(bool bHiPri, BYTE bLoc);

6
Source/quests.cpp

@ -29,7 +29,7 @@ namespace devilution {
bool QuestLogIsOpen; bool QuestLogIsOpen;
std::optional<CelSprite> pQLogCel; std::optional<CelSprite> pQLogCel;
/** Contains the quests of the current game. */ /** Contains the quests of the current game. */
QuestStruct Quests[MAXQUESTS]; Quest Quests[MAXQUESTS];
int ReturnLvlX; int ReturnLvlX;
int ReturnLvlY; int ReturnLvlY;
dungeon_type ReturnLevelType; dungeon_type ReturnLevelType;
@ -346,7 +346,7 @@ void InitQuests()
Quests[Q_BETRAYER]._qvar1 = 2; Quests[Q_BETRAYER]._qvar1 = 2;
} }
void InitialiseQuestPools(uint32_t seed, QuestStruct quests[]) void InitialiseQuestPools(uint32_t seed, Quest quests[])
{ {
SetRndSeed(seed); SetRndSeed(seed);
if (GenerateRnd(2) != 0) if (GenerateRnd(2) != 0)
@ -871,7 +871,7 @@ void SetMultiQuest(int q, quest_state s, bool log, int v1)
} }
} }
bool QuestStruct::IsAvailable() bool Quest::IsAvailable()
{ {
if (setlevel) if (setlevel)
return false; return false;

6
Source/quests.h

@ -44,7 +44,7 @@ enum quest_state : uint8_t {
QUEST_INVALID = 0xFF, QUEST_INVALID = 0xFF,
}; };
struct QuestStruct { struct Quest {
quest_id _qidx; quest_id _qidx;
quest_state _qactive; quest_state _qactive;
uint8_t _qlevel; uint8_t _qlevel;
@ -73,7 +73,7 @@ struct QuestDataStruct {
extern bool QuestLogIsOpen; extern bool QuestLogIsOpen;
extern std::optional<CelSprite> pQLogCel; extern std::optional<CelSprite> pQLogCel;
extern QuestStruct Quests[MAXQUESTS]; extern Quest Quests[MAXQUESTS];
extern int ReturnLvlX; extern int ReturnLvlX;
extern int ReturnLvlY; extern int ReturnLvlY;
extern dungeon_type ReturnLevelType; extern dungeon_type ReturnLevelType;
@ -86,7 +86,7 @@ void InitQuests();
* @param seed The seed used to control which quests are deactivated * @param seed The seed used to control which quests are deactivated
* @param quests The available quest list, this function will make some of them inactive by the time it returns * @param quests The available quest list, this function will make some of them inactive by the time it returns
*/ */
void InitialiseQuestPools(uint32_t seed, QuestStruct quests[]); void InitialiseQuestPools(uint32_t seed, Quest quests[]);
void CheckQuests(); void CheckQuests();
bool ForceQuests(); bool ForceQuests();
void CheckQuestKill(const Monster &monster, bool sendmsg); void CheckQuestKill(const Monster &monster, bool sendmsg);

Loading…
Cancel
Save