Skip to content

Commit

Permalink
Merge pull request #12 from travisdmathis/fix/update-quests
Browse files Browse the repository at this point in the history
updates quests.killed to quests.field0
  • Loading branch information
paulpach authored Oct 15, 2018
2 parents ef6673f + 58d4001 commit 5b47093
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Database_MySql.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ ON DELETE CASCADE ON UPDATE CASCADE
CREATE TABLE IF NOT EXISTS character_quests(
`character` VARCHAR(16) NOT NULL,
name VARCHAR(50) NOT NULL,
killed INT NOT NULL,
field0 INT NOT NULL,
completed BOOLEAN NOT NULL,
PRIMARY KEY(`character`, name),
Expand Down Expand Up @@ -547,7 +547,7 @@ private static void LoadQuests(Player player)
{
// load quests

using (var reader = GetReader("SELECT name, killed, completed FROM character_quests WHERE `character`=@character",
using (var reader = GetReader("SELECT name, field0, completed FROM character_quests WHERE `character`=@character",
new SqlParameter("@character", player.name)))
{

Expand All @@ -558,7 +558,7 @@ private static void LoadQuests(Player player)
if (ScriptableQuest.dict.TryGetValue(questName.GetStableHashCode(), out questData))
{
Quest quest = new Quest(questData);
quest.killed = (int)reader["killed"];
quest.field0 = (int)reader["field0"];
quest.completed = (bool)reader["completed"];
player.quests.Add(quest);
}
Expand Down Expand Up @@ -767,10 +767,10 @@ private static void SaveQuests(Player player, MySqlCommand command)
ExecuteNonQueryMySql(command, "DELETE FROM character_quests WHERE `character`=@character", new SqlParameter("@character", player.name));
foreach (var quest in player.quests)
{
ExecuteNonQueryMySql(command, "INSERT INTO character_quests VALUES (@character, @name, @killed, @completed)",
ExecuteNonQueryMySql(command, "INSERT INTO character_quests VALUES (@character, @name, @field0, @completed)",
new SqlParameter("@character", player.name),
new SqlParameter("@name", quest.name),
new SqlParameter("@killed", quest.killed),
new SqlParameter("@field0", quest.field0),
new SqlParameter("@completed", quest.completed));
}
}
Expand Down

0 comments on commit 5b47093

Please sign in to comment.