Skip to content

Commit

Permalink
core: small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick committed Feb 6, 2022
1 parent 2c5790d commit d1256b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cstrike/addons/amxmodx/configs/map_manager.cfg
Expand Up @@ -91,15 +91,15 @@ mapm_default_map "de_dust2"
// 0 - minutes, 1 - rounds
mapm_extended_type "0"

// Максимальное число продлений карты mapm_extended_type "0".
// Максимальное число продлений карты.
// -1 - бесконечное число продлений
mapm_extended_map_max "3"

// Продление в минутах mapm_extended_type "1".
// Продление в минутах для mapm_extended_type "0".
// minutes
mapm_extended_time "15"

// Продление в раундах для
// Продление в раундах для mapm_extended_type "1".
// rounds
mapm_extended_rounds "3"

Expand Down
14 changes: 9 additions & 5 deletions cstrike/addons/amxmodx/scripting/map_manager_core.sma
Expand Up @@ -7,7 +7,7 @@
#endif

#define PLUGIN "Map Manager: Core"
#define VERSION "3.1.2"
#define VERSION "3.1.3"
#define AUTHOR "Mistrick"

#pragma semicolon 1
Expand Down Expand Up @@ -334,8 +334,7 @@ public native_add_vote_to_item(plugin, params)
}

new value = get_param(arg_value);
g_iVotes[item] += value;
g_iTotalVotes += value;
add_item_votes(item, value);

return 1;
}
Expand Down Expand Up @@ -669,8 +668,8 @@ public votemenu_handler(id, key)
}

new original = get_original_num(key - g_iOffset);
g_iVotes[original]++;
g_iTotalVotes++;
add_item_votes(original, 1);

g_iVoted[id] = key;

// TODO: add forward if someone want add more votes for admin, etc.
Expand All @@ -690,6 +689,11 @@ public votemenu_handler(id, key)

return PLUGIN_HANDLED;
}
add_item_votes(item, value)
{
g_iVotes[item] += value;
g_iTotalVotes += value;
}
finish_vote()
{
g_bVoteStarted = false;
Expand Down

0 comments on commit d1256b6

Please sign in to comment.