forked from stfc2/Scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
world.php
48 lines (36 loc) · 1.72 KB
/
world.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
This file is part of STFC.
Copyright 2006-2007 by Michael Krauss ([email protected]) and Tobias Gafner
STFC is based on STGC,
Copyright 2003-2007 by Florian Brede ([email protected]) and Philipp Schmidt
STFC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
STFC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$sql = 'UPDATE planets
SET planet_covered_distance = planet_covered_distance + planet_tick_cdistance
WHERE planet_max_cdistance > (planet_covered_distance + planet_tick_cdistance)';
if(!$db->query($sql)) {
$sdl->log('- <b>Error:</b> Could not update first planet rotation data! CONTINUE');
}
$sql = 'UPDATE planets
SET planet_covered_distance = (planet_covered_distance + planet_tick_cdistance - planet_max_cdistance)
WHERE planet_max_cdistance <= (planet_covered_distance + planet_tick_cdistance)';
if(!$db->query($sql)) {
$sdl->log('- <b>Error:</b> Could not update second planet rotation data! CONTINUE');
}
$sql = 'UPDATE planets
SET planet_current_x = 0,
planet_current_y = 0';
if(!$db->query($sql)) {
$sdl->log('- <b>Error:</b> Couldnot update planet current coord data! CONTINUE');
}
?>