refactoring and improvements
This commit is contained in:
@ -389,20 +389,19 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
||||
* @return mixed
|
||||
*/
|
||||
private function getTarget($login) {
|
||||
$pid = 1;
|
||||
|
||||
/** @var Player $player */
|
||||
$player = null;
|
||||
foreach($this->maniaControl->playerManager->getPlayers() as $player) {
|
||||
if ($login == $player->login || $login == $pid || $login == $player->nickname) {
|
||||
if ($login == $player->login || $login == $player->pid || $login == $player->nickname) {
|
||||
return $player->nickname;
|
||||
}
|
||||
$pid++;
|
||||
}
|
||||
|
||||
if ($login == 'lj' && $pid > 1) {
|
||||
if ($player && $login == 'lj') {
|
||||
return $player->nickname;
|
||||
}
|
||||
|
||||
return $login;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +270,9 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
|
||||
|
||||
// Check old record of the player
|
||||
$oldRecord = $this->getLocalRecord($map, $player);
|
||||
$oldRank = -1;
|
||||
if ($oldRecord) {
|
||||
$oldRank = $oldRecord->rank;
|
||||
if ($oldRecord->time < $time) {
|
||||
// Not improved
|
||||
return;
|
||||
|
Reference in New Issue
Block a user