2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-01-28 22:47:56 +03:00

Minor refactoring rg_round_end

This commit is contained in:
s1lent 2017-09-25 03:21:03 +07:00
parent 396e15a81d
commit b9f817a5ae
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 15 additions and 12 deletions

View File

@ -4280,7 +4280,7 @@ enum CWeaponBox_Members
{ {
/* /*
* Description: - * Description: -
* Member type: class CBasePlayerItem *[6] * Member type: class CBasePlayerItem *[MAX_ITEM_TYPES]
* Get params: get_member(index, member, element); * Get params: get_member(index, member, element);
* Set params: set_member(index, member, value, element); * Set params: set_member(index, member, value, element);
*/ */
@ -4288,15 +4288,15 @@ enum CWeaponBox_Members
/* /*
* Description: - * Description: -
* Member type: string_t [32] * Member type: string_t [MAX_AMMO_SLOTS]
* Get params: get_member(index, member, dest[], const lenght); * Get params: get_member(index, member, dest[], const lenght, element);
* Set params: set_member(index, member, const source[]); * Set params: set_member(index, member, const source[], element);
*/ */
m_WeaponBox_rgiszAmmo, m_WeaponBox_rgiszAmmo,
/* /*
* Description: - * Description: -
* Member type: int [32] * Member type: int [MAX_AMMO_SLOTS]
* Get params: get_member(index, member, element); * Get params: get_member(index, member, element);
* Set params: set_member(index, member, value, element); * Set params: set_member(index, member, value, element);
*/ */

View File

@ -400,22 +400,25 @@ cell AMX_NATIVE_CALL rg_round_end(AMX *amx, cell *params)
char sentence[190], message[190]; char sentence[190], message[190];
Q_strlcpy(sentence, getAmxString(amx, params[arg_sentence])); Q_strlcpy(sentence, getAmxString(amx, params[arg_sentence]));
Q_strlcpy(message, getAmxString(amx, params[arg_message])); Q_strlcpy(message, getAmxString(amx, params[arg_message]));
const char *_sentence = sentence;
const char *_message = message;
if (event != ROUND_NONE) { if (event != ROUND_NONE) {
auto& lst = msg_sentence_list[event]; auto& lst = msg_sentence_list[event];
if (strcmp(sentence, "default") == 0) if (strcmp(_sentence, "default") == 0)
Q_strlcpy(sentence, lst.sentence); _sentence = lst.sentence;
if (strcmp(message, "default") == 0) if (strcmp(message, "default") == 0)
Q_strlcpy(message, lst.msg); _message = lst.msg;
} }
if (sentence[0] != '\0') if (_sentence[0] != '\0')
{ {
Broadcast(sentence); Broadcast(_sentence);
} }
CSGameRules()->EndRoundMessage(message, event); CSGameRules()->EndRoundMessage(_message, event);
CSGameRules()->TerminateRound(CAmxArg(amx, params[arg_delay]), winstatus); CSGameRules()->TerminateRound(CAmxArg(amx, params[arg_delay]), winstatus);
return TRUE; return TRUE;
} }