mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fix waiting loop timing bug - subtract delay when releasing loop buildings
Fixes #126
This commit is contained in:
@@ -476,12 +476,14 @@ class Automation {
|
||||
|
||||
// update data that can be done in one swoop instead of using multiple update queries
|
||||
// no special checks for Romans
|
||||
$loopDelay = ceil(60 / SPEED);
|
||||
foreach ($loopconUpdates as $villageId => $updateCondition) {
|
||||
$database->query(
|
||||
"UPDATE
|
||||
".TB_PREFIX."bdata
|
||||
SET
|
||||
loopcon = 0
|
||||
loopcon = 0,
|
||||
timestamp = timestamp - ".$loopDelay."
|
||||
WHERE
|
||||
loopcon = 1 AND
|
||||
master = 0 AND
|
||||
|
||||
@@ -816,7 +816,8 @@ class Building {
|
||||
if (count($stillbuildingarray) == 1) {
|
||||
if($stillbuildingarray[0]['loopcon'] == 1) {
|
||||
//$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0,timestamp=".(time()+$stillbuildingarray[0]['timestamp']-$innertimestamp)." WHERE id=".$stillbuildingarray[0]['id'];
|
||||
$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0 WHERE id=".(int) $stillbuildingarray[0]['id'];
|
||||
$loopDelay = ceil(60 / SPEED);
|
||||
$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0, timestamp = timestamp - ".$loopDelay." WHERE id=".(int) $stillbuildingarray[0]['id'];
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user