Commit 71e90eec authored by hisuinohoshi's avatar hisuinohoshi

fix

parent 70722897
......@@ -259,14 +259,19 @@ function save_gameinfo()
global $groomid,$gamenum,$gamestate,$lastupdate,$starttime,$winmode,$winner,$arealist,$areanum,$areatime,$areawarn,$validnum,$alivenum,$deathnum,$afktime,$optime,$weather,$hack,$combonum,$gamevars;
if(!isset($gamenum)||!isset($gamestate)){return;}
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE type=0");
$validnum = $db->num_rows($result);
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE hp>0 AND type=0");
$alivenum = $db->num_rows($result);
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE hp<=0 OR state>=10");
$deathnum = $db->num_rows($result);
if($gamestate > 10)
{
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE type=0");
$validnum = $db->num_rows($result);
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE hp>0 AND type=0");
$alivenum = $db->num_rows($result);
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE hp<=0 OR state>=10");
$deathnum = $db->num_rows($result);
}
else
{
$validnum = $alivenum = $deathnum = 0;
}
if(empty($afktime)){$afktime = $now;}
if(empty($optime)){$optime = $now;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment