Fix unknown consume type 0

This commit is contained in:
Ethan O'Brien 2024-10-18 16:41:10 -05:00
parent a31d3b06d7
commit 33737819a5
3 changed files with 6 additions and 4 deletions

View file

@ -106,7 +106,9 @@ pub fn give_item(master_item_id: i64, amount: i64, user: &mut JsonValue) -> bool
}
pub fn use_item(item: &JsonValue, multiplier: i64, user: &mut JsonValue) {
if item["consumeType"] == 1 {
if item["consumeType"] == 0 {
// Is anything really ever free...?
} else if item["consumeType"] == 1 {
remove_gems(user, item["amount"].as_i64().unwrap());
} else if item["consumeType"] == 4 {
use_itemm(item["value"].as_i64().unwrap(), item["amount"].as_i64().unwrap() * multiplier, user);

View file

@ -102,7 +102,7 @@ pub fn lottery(_req: HttpRequest) -> Option<JsonValue> {
pub fn lottery_post(req: HttpRequest, body: String) -> Option<JsonValue> {
let key = global::get_login(req.headers(), &body);
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
println!("lottery: {}", body);
//println!("lottery: {}", body);
let mut user = userdata::get_acc(&key);
let user2 = userdata::get_acc(&key);
let mut missions = userdata::get_acc_missions(&key);