battles/classes/cave/lose.php

23 lines
913 B
PHP

<?php
if (in_array($user->room, Config::$caverooms)) {
$cavedata = Config::$cavedata ?? [];
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if (!isset($cavedata[$user->room]['x' . $floor])) {
$floor = 1;
}
}
$lomka1 = $lomka;
foreach ($lomka1 as $k => $v) {
if ($v < _BOTSEPARATOR_) {
if (in_array($user->room, Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
}
if ($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "' . $v . '" LIMIT 1');
exit('Suka');
}
}
}