mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fixed a bug in the troops training
If the speed of the server is very high and the single troop training time is 0, you can now train troops instantly.
This commit is contained in:
@@ -640,7 +640,6 @@ private function trainUnit($unit,$amt,$great=false) {
|
||||
$clay = ${'u'.$unit}['clay'] * $amt * ($great?3:1);
|
||||
$iron = ${'u'.$unit}['iron'] * $amt * ($great?3:1);
|
||||
$crop = ${'u'.$unit}['crop'] * $amt * ($great?3:1);
|
||||
$each = ($each == 0) ? 1 : $each;
|
||||
$time = $each*$amt;
|
||||
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0) && $amt > 0) {
|
||||
$database->trainUnit($village->wid,$unit+($great?60:0),$amt,${'u'.$unit}['pop'],$each,time()+$time,0);
|
||||
|
||||
Reference in New Issue
Block a user