mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-23 20:35:04 +01:00
temporarily override the minimum stamp value
This commit is contained in:
@@ -275,8 +275,7 @@ func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
bf.WriteUint8(questType)
|
bf.WriteUint8(questType)
|
||||||
if questType == 9 {
|
if questType == 9 {
|
||||||
var stamps int
|
var stamps, required int
|
||||||
var amount = 1
|
|
||||||
var deadline time.Time
|
var deadline time.Time
|
||||||
err := s.server.db.QueryRow(`SELECT COUNT(*) FROM campaign_state WHERE campaign_id = (
|
err := s.server.db.QueryRow(`SELECT COUNT(*) FROM campaign_state WHERE campaign_id = (
|
||||||
SELECT campaign_id
|
SELECT campaign_id
|
||||||
@@ -291,9 +290,14 @@ func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
|||||||
FROM campaign_rewards
|
FROM campaign_rewards
|
||||||
WHERE item_type = 9
|
WHERE item_type = 9
|
||||||
AND item_id = $1
|
AND item_id = $1
|
||||||
)`, questId).Scan(&amount, &deadline)
|
)`, questId).Scan(&required, &deadline)
|
||||||
|
|
||||||
|
if required == 0 {
|
||||||
|
required = 1 // TODO: I don't understand how this is supposed to work
|
||||||
|
}
|
||||||
|
|
||||||
// Check if there are enough stamps to activate the quest, the deadline hasn't passed, and there are no errors
|
// Check if there are enough stamps to activate the quest, the deadline hasn't passed, and there are no errors
|
||||||
if stamps >= amount && deadline.After(time.Now()) && err == nil && err2 == nil {
|
if stamps >= required && deadline.After(time.Now()) && err == nil && err2 == nil {
|
||||||
bf.WriteBool(true)
|
bf.WriteBool(true)
|
||||||
} else {
|
} else {
|
||||||
bf.WriteBool(false)
|
bf.WriteBool(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user