Skip to content

Commit

Permalink
* More flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzimba committed Jan 26, 2025
1 parent e0475de commit f436a2e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions data/XML/groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<flags>
<flag talkorangehelpchannel="1" />
<flag cannotbemuted="1" />
<flag allowidle="1" />
</flags>
</group>
<group id="3" name="senior tutor" access="0" maxdepotitems="0" maxvipentries="200">
Expand All @@ -13,6 +14,7 @@
<flag cantalkredprivate="1" />
<flag cantalkredchannel="1" />
<flag cannotbemuted="1" />
<flag allowidle="1" />
</flags>
</group>
<group id="4" name="gamemaster" access="1" maxdepotitems="0" maxvipentries="200" outfit="75">
Expand Down Expand Up @@ -58,6 +60,8 @@
<flag isalwayspremium="1" />
<flag canmapclickteleport="0" />
<flag hasfulllight="1" />
<flag allowidle="1" />
<flag notgainunjustified="1" />
</flags>
</group>
<group id="5" name="community manager" access="1" maxdepotitems="0" maxvipentries="200" outfit="266">
Expand Down Expand Up @@ -103,6 +107,8 @@
<flag isalwayspremium="1" />
<flag canmapclickteleport="0" />
<flag hasfulllight="1" />
<flag allowidle="1" />
<flag notgainunjustified="1" />
</flags>
</group>
<group id="6" name="god" access="1" maxdepotitems="0" maxvipentries="200" outfit="302">
Expand Down Expand Up @@ -149,6 +155,8 @@
<flag canmapclickteleport="1" />
<flag canmovefromfar="1" />
<flag hasfulllight="1" />
<flag allowidle="1" />
<flag notgainunjustified="1" />
</flags>
</group>
<group id="7" name="game tester" access="0" maxdepotitems="0" maxvipentries="200">
Expand Down
2 changes: 2 additions & 0 deletions data/scripts/talkactions/god/flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ local PlayerFlags_t = {
["IsGameTester"] = IsGameTester,
["CanMoveFromFar"] = CanMoveFromFar,
["HasFullLight"] = HasFullLight,
["AllowIdle"] = AllowIdle,
["NotGainUnjustified"] = NotGainUnjustified,
}

local function sendValidKeys(player)
Expand Down
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6563,7 +6563,7 @@ void Player::clearAttacked() {
}

void Player::addUnjustifiedDead(const std::shared_ptr<Player> &attacked) {
if (hasFlag(PlayerFlags_t::NotGainInFight) || attacked == getPlayer() || g_game().getWorldType() == WORLD_TYPE_PVP_ENFORCED) {
if (hasFlag(PlayerFlags_t::NotGainInFight) || hasFlag(PlayerFlags_t::NotGainUnjustified) || attacked == getPlayer() || g_game().getWorldType() == WORLD_TYPE_PVP_ENFORCED) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10565,7 +10565,7 @@ void Game::playerCheckActivity(const std::string &playerName, int interval) {
return;
}

if (!player->isAccessPlayer()) {
if (!player->hasFlag(PlayerFlags_t::AllowIdle)) {
player->m_deathTime += interval;
const int32_t kickAfterMinutes = g_configManager().getNumber(KICK_AFTER_MINUTES);
if (player->m_deathTime > (kickAfterMinutes * 60000) + 60000) {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/utils_definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ enum class PlayerFlags_t : uint8_t {
IsGameTester,
CanMoveFromFar,
HasFullLight,
AllowIdle,
NotGainUnjustified,

// Must always be the last
FlagLast
Expand Down

0 comments on commit f436a2e

Please sign in to comment.