From 7d0f5cb400f9b3fc0beecdce59e086241d86e514 Mon Sep 17 00:00:00 2001 From: monster860 Date: Tue, 4 Apr 2017 18:50:24 -0400 Subject: [PATCH] Fixes - Makes it so that log_client_to_db is called before mob/Login() - Makes it so can_vote() doesn't runtime if the player_age isn't a number --- code/modules/client/client procs.dm | 5 +++-- code/modules/mob/new_player/poll.dm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index eb45d0d7e4d..894b5d39951 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -389,7 +389,6 @@ prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning - . = ..() //calls mob.Login() spawn() // Goonchat does some non-instant checks in start() chatOutput.start() @@ -416,6 +415,8 @@ winset(src, null, "command=\".configure graphics-hwmode on\"") log_client_to_db(tdata) + + . = ..() //calls mob.Login() if(ckey in clientmessages) for(var/message in clientmessages[ckey]) @@ -487,7 +488,7 @@ var/DBQuery/query = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[ckey]'") query.Execute() var/sql_id = 0 - player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if their is a record. + player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if there is a record. while(query.NextRow()) sql_id = query.item[1] player_age = text2num(query.item[2]) diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm index 961740001d7..a603369c5b5 100644 --- a/code/modules/mob/new_player/poll.dm +++ b/code/modules/mob/new_player/poll.dm @@ -8,7 +8,7 @@ handle_player_polling() /client/proc/can_vote() - return player_age >= 30 + return istext(player_age) || player_age >= 30 /client/proc/handle_player_polling() establish_db_connection()