forked from halo-battle/game
Version 1.5
This commit is contained in:
parent
083eb365c5
commit
a66ed9797b
157 changed files with 29787 additions and 3531 deletions
|
|
@ -10,6 +10,7 @@ class gererFile {
|
|||
}
|
||||
|
||||
function addObjet($objet,$nombre,$temps) {
|
||||
$this->file = array_merge($this->file);
|
||||
$nbF = count($this->file);
|
||||
if ($nbF >= $this->limite) return false;
|
||||
$this->chaine = false;
|
||||
|
|
@ -30,21 +31,23 @@ class gererFile {
|
|||
|
||||
function delobjet($objet, $nombre=1) {
|
||||
$this->file = array_merge($this->file);
|
||||
for($i=count($this->file)-1 ; $i>=0 ; $i--) {
|
||||
for($i = count($this->file)-1; $i >= 0; $i--) {
|
||||
if($this->file[$i][0] == $objet){
|
||||
$nombre=min($nombre, $this->file[$i][1]);
|
||||
$nombre = min($nombre, $this->file[$i][1]);
|
||||
$this->file[$i][1] -= $nombre;
|
||||
if($this->file[$i][1]<=0) {
|
||||
if($this->file[$i][1] <= 0) {
|
||||
unset($this->file[$i]);
|
||||
$this->file = array_merge($this->file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ($i == 0) $this->timestamp = time();
|
||||
if ($i == 1) $this->timestamp = time();
|
||||
}
|
||||
return $nombre;
|
||||
}
|
||||
|
||||
function pret() {
|
||||
$this->file = array_merge($this->file);
|
||||
$out = array();
|
||||
$nbF = count($this->file);
|
||||
if ($nbF == 1 && $this->chaine) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue