Skip to content

Commit

Permalink
Reposition code for setting ranks (addition to previous commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jun 13, 2024
1 parent d9c1b25 commit 47a19e8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions system/pages/guilds/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@
$new_guild->setOwner($player);
$new_guild->save();
$new_guild->setCustomField('description', setting('core.guild_description_default'));
//$new_guild->setCustomField('creationdata', time());
$ranks = $new_guild->getGuildRanksList();
$ranks->orderBy('level', POT::ORDER_DESC);
foreach($ranks as $rank) {
/**
* @var OTS_GuildRank $rank
*/
if($rank->getLevel() == 3) {
$player->setRank($rank);
}
}

if ($db->hasTable('guild_ranks')) {
if (!GuildRank::where('guild_id', $new_guild->getId())->first()) {
Expand All @@ -144,7 +133,18 @@
}
}
}


$ranks = $new_guild->getGuildRanksList();
$ranks->orderBy('level', POT::ORDER_DESC);
foreach($ranks as $rank) {
/**
* @var OTS_GuildRank $rank
*/
if($rank->getLevel() == 3) {
$player->setRank($rank);
}
}

$twig->display('guilds.create.success.html.twig', array(
'guild_name' => $guild_name,
'leader_name' => $player->getName()
Expand Down

0 comments on commit 47a19e8

Please sign in to comment.