dbcon IsConnected Runtime Fix (#10676)

* dbcon IsConnected Runtime Fix

* Update code/modules/admin/verbs/warning.dm

Co-authored-by: Werner <1331699+Arrow768@users.noreply.github.com>

* Update code/modules/mob/abstract/new_player/menu.dm

Co-authored-by: Werner <1331699+Arrow768@users.noreply.github.com>

* Update code/modules/admin/verbs/warning.dm

Co-authored-by: Werner <1331699+Arrow768@users.noreply.github.com>

Co-authored-by: Werner <1331699+Arrow768@users.noreply.github.com>
This commit is contained in:
Geeves
2020-11-28 22:38:21 +02:00
committed by GitHub
co-authored by Werner
parent f54a89b9f8
commit c793dd8a7f
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -311,8 +311,7 @@
var/dcolor = "#ffdddd" //dark colour, severity = 1
var/ecolor = "#e3e3e3" //gray colour, expired = 1
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
if (!establish_db_connection(dbcon))
alert("Connection to the SQL database lost. Aborting. Please alert the database admin!")
return
+1 -1
View File
@@ -199,7 +199,7 @@
/obj/screen/new_player/selection/polls/Initialize()
. = ..()
if(dbcon.IsConnected())
if(establish_db_connection(dbcon))
var/mob/M = hud.mymob
var/isadmin = M && M.client && M.client.holder
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM ss13_poll_vote WHERE ckey = \"[M.ckey]\") AND id NOT IN (SELECT pollid FROM ss13_poll_textreply WHERE ckey = \"[M.ckey]\")")