Replaced NULL with nullptr (#8298)
This commit is contained in:
@@ -88,7 +88,7 @@ struct s_atcommand_alias_info{
|
||||
char atcommand_symbol = '@'; // first char of the commands
|
||||
char charcommand_symbol = '#';
|
||||
|
||||
static DBMap* atcommand_db = NULL; //name -> AtCommandInfo
|
||||
static DBMap* atcommand_db = nullptr; //name -> AtCommandInfo
|
||||
|
||||
static AtCommandInfo* get_atcommandinfo_byname( const char* name );
|
||||
|
||||
@@ -206,14 +206,14 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
|
||||
|
||||
ARR_FIND( 0, atcmd_binding_count, i, strcmpi(atcmd_binding[i]->command, name) == 0 );
|
||||
|
||||
return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL;
|
||||
return ( i < atcmd_binding_count ) ? atcmd_binding[i] : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the help string associated with a given command.
|
||||
*
|
||||
* @param name the name of the command to retrieve help information for
|
||||
* @return the string associated with the command, or NULL
|
||||
* @return the string associated with the command, or nullptr
|
||||
*/
|
||||
static const char* atcommand_help_string( const char* command ){
|
||||
// remove the prefix symbol for the raw name of the command
|
||||
@@ -611,7 +611,7 @@ ACMD_FUNC(mapmove)
|
||||
if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
|
||||
{ //This is to prevent the pc_setpos call from printing an error.
|
||||
clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell.
|
||||
if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
|
||||
if (!map_search_freecell(nullptr, m, &x, &y, 10, 10, 1))
|
||||
x = y = 0; //Invalid cell, use random spot.
|
||||
}
|
||||
if ((map_getmapflag(m, MF_NOWARPTO) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) || !pc_job_can_entermap((enum e_job)sd->status.class_, m, pc_get_group_level(sd))) {
|
||||
@@ -647,7 +647,7 @@ ACMD_FUNC(where)
|
||||
}
|
||||
|
||||
pl_sd = map_nick2sd(atcmd_player_name,true);
|
||||
if (pl_sd == NULL ||
|
||||
if (pl_sd == nullptr ||
|
||||
strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 ||
|
||||
(pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
|
||||
) {
|
||||
@@ -677,7 +677,7 @@ ACMD_FUNC(jumpto)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL)
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == nullptr && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -735,7 +735,7 @@ ACMD_FUNC(jump)
|
||||
if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
|
||||
{ //This is to prevent the pc_setpos call from printing an error.
|
||||
clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell.
|
||||
if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
|
||||
if (!map_search_freecell(nullptr, sd->bl.m, &x, &y, 10, 10, 1))
|
||||
x = y = 0; //Invalid cell, use random spot.
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ ACMD_FUNC(jump)
|
||||
*------------------------------------------*/
|
||||
ACMD_FUNC(who) {
|
||||
map_session_data* pl_sd = nullptr;;
|
||||
struct s_mapiterator *iter = NULL;
|
||||
struct s_mapiterator *iter = nullptr;
|
||||
char player_name[NAME_LENGTH] = "";
|
||||
int count = 0;
|
||||
int level = 0;
|
||||
@@ -766,7 +766,7 @@ ACMD_FUNC(who) {
|
||||
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
if (strstr(command, "map") != NULL) {
|
||||
if (strstr(command, "map") != nullptr) {
|
||||
char map_name[MAP_NAME_LENGTH_EXT] = "";
|
||||
if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0)
|
||||
map_id = sd->bl.m;
|
||||
@@ -774,9 +774,9 @@ ACMD_FUNC(who) {
|
||||
sscanf(message, "%23s", player_name);
|
||||
}
|
||||
|
||||
if (strstr(command, "2") != NULL)
|
||||
if (strstr(command, "2") != nullptr)
|
||||
display_type = 2;
|
||||
else if (strstr(command, "3") != NULL)
|
||||
else if (strstr(command, "3") != nullptr)
|
||||
display_type = 3;
|
||||
|
||||
level = pc_get_group_level(sd);
|
||||
@@ -785,7 +785,7 @@ ACMD_FUNC(who) {
|
||||
iter = mapit_getallusers();
|
||||
for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) {
|
||||
if (!((pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) || pc_isinvisible(pl_sd)) && pc_get_group_level(pl_sd) > level)) { // you can look only lower or same level
|
||||
if (stristr(pl_sd->status.name, player_name) == NULL // search with no case sensitive
|
||||
if (stristr(pl_sd->status.name, player_name) == nullptr // search with no case sensitive
|
||||
|| (map_id >= 0 && pl_sd->bl.m != map_id))
|
||||
continue;
|
||||
switch (display_type) {
|
||||
@@ -813,9 +813,9 @@ ACMD_FUNC(who) {
|
||||
StringBuf_Printf(&buf, msg_txt(sd,343), pl_sd->status.name); // "Name: %s "
|
||||
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
|
||||
StringBuf_Printf(&buf, msg_txt(sd,344), pl_sd->group->name.c_str()); // "(%s) "
|
||||
if (p != NULL)
|
||||
if (p != nullptr)
|
||||
StringBuf_Printf(&buf, msg_txt(sd,345), p->party.name); // " | Party: '%s'"
|
||||
if (g != NULL)
|
||||
if (g != nullptr)
|
||||
StringBuf_Printf(&buf, msg_txt(sd,346), g->guild.name); // " | Guild: '%s'"
|
||||
break;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ ACMD_FUNC(whogm)
|
||||
for (j = 0; player_name[j]; j++)
|
||||
player_name[j] = TOLOWER(player_name[j]);
|
||||
// search with no case sensitive
|
||||
if (strstr(player_name, match_text) == NULL)
|
||||
if (strstr(player_name, match_text) == nullptr)
|
||||
continue;
|
||||
}
|
||||
if (pl_level > level) {
|
||||
@@ -1262,7 +1262,7 @@ ACMD_FUNC(kami)
|
||||
}
|
||||
|
||||
sscanf(message, "%255[^\n]", atcmd_output);
|
||||
if (strstr(command, "l") != NULL)
|
||||
if (strstr(command, "l") != nullptr)
|
||||
clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
|
||||
else
|
||||
intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? BC_BLUE : BC_DEFAULT);
|
||||
@@ -1312,7 +1312,7 @@ ACMD_FUNC(heal)
|
||||
}
|
||||
|
||||
if ( hp < 0 && sp <= 0 ) {
|
||||
status_damage(NULL, &sd->bl, -hp, -sp, 0, 0, 0);
|
||||
status_damage(nullptr, &sd->bl, -hp, -sp, 0, 0, 0);
|
||||
clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, DMG_ENDURE, 0, false);
|
||||
clif_displaymessage(fd, msg_txt(sd,156)); // HP or/and SP modified.
|
||||
return 0;
|
||||
@@ -1323,7 +1323,7 @@ ACMD_FUNC(heal)
|
||||
if (hp > 0)
|
||||
status_heal(&sd->bl, hp, 0, 0);
|
||||
else {
|
||||
status_damage(NULL, &sd->bl, -hp, 0, 0, 0, 0);
|
||||
status_damage(nullptr, &sd->bl, -hp, 0, 0, 0, 0);
|
||||
clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, DMG_ENDURE, 0, false);
|
||||
}
|
||||
}
|
||||
@@ -1332,7 +1332,7 @@ ACMD_FUNC(heal)
|
||||
if (sp > 0)
|
||||
status_heal(&sd->bl, 0, sp, 0);
|
||||
else
|
||||
status_damage(NULL, &sd->bl, 0, -sp, 0, 0, 0);
|
||||
status_damage(nullptr, &sd->bl, 0, -sp, 0, 0, 0);
|
||||
}
|
||||
|
||||
clif_displaymessage(fd, msg_txt(sd,156)); // HP or/and SP modified.
|
||||
@@ -1365,7 +1365,7 @@ ACMD_FUNC(healap)
|
||||
clif_displaymessage(fd, msg_txt(sd, 821));// AP recovered.
|
||||
return 0;
|
||||
}else{
|
||||
status_damage(NULL, &sd->bl, 0, 0, -ap, 0, 0, 0);
|
||||
status_damage(nullptr, &sd->bl, 0, 0, -ap, 0, 0, 0);
|
||||
clif_displaymessage(fd, msg_txt(sd, 822));// AP modified.
|
||||
return 0;
|
||||
}
|
||||
@@ -1424,7 +1424,7 @@ ACMD_FUNC(item)
|
||||
}
|
||||
|
||||
items.push_back( item );
|
||||
itemlist = strtok(NULL, ":"); //next itemline
|
||||
itemlist = strtok(nullptr, ":"); //next itemline
|
||||
}
|
||||
|
||||
if (number <= 0)
|
||||
@@ -3271,7 +3271,7 @@ ACMD_FUNC(recall) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL)
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == nullptr && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -3607,7 +3607,7 @@ ACMD_FUNC(kick)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,false)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL)
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,false)) == nullptr && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -3638,7 +3638,7 @@ ACMD_FUNC(kickall)
|
||||
{
|
||||
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kick only lower or same gm level
|
||||
if (sd->status.account_id != pl_sd->status.account_id)
|
||||
clif_GM_kick(NULL, pl_sd);
|
||||
clif_GM_kick(nullptr, pl_sd);
|
||||
}
|
||||
}
|
||||
mapit_free(iter);
|
||||
@@ -4156,8 +4156,8 @@ ACMD_FUNC(partyrecall)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number
|
||||
(p = party_search(atoi(message))) == NULL)
|
||||
if ((p = party_searchname(party_name)) == nullptr && // name first to avoid error when name begin with a number
|
||||
(p = party_search(atoi(message))) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,96)); // Incorrect name or ID, or no one from the party is online.
|
||||
return -1;
|
||||
@@ -4369,7 +4369,7 @@ ACMD_FUNC(partysharelvl) {
|
||||
ACMD_FUNC(mapinfo) {
|
||||
map_session_data* pl_sd;
|
||||
struct s_mapiterator* iter;
|
||||
struct chat_data *cd = NULL;
|
||||
struct chat_data *cd = nullptr;
|
||||
char direction[12];
|
||||
int i, m_id, chat_num = 0, list = 0, vend_num = 0;
|
||||
unsigned short m_index;
|
||||
@@ -4410,7 +4410,7 @@ ACMD_FUNC(mapinfo) {
|
||||
if( pl_sd->mapindex == m_index ) {
|
||||
if( pl_sd->state.vending )
|
||||
vend_num++;
|
||||
else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd )
|
||||
else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != nullptr && cd->usersd[0] == pl_sd )
|
||||
chat_num++;
|
||||
}
|
||||
}
|
||||
@@ -4673,7 +4673,7 @@ ACMD_FUNC(mapinfo) {
|
||||
iter = mapit_getallusers();
|
||||
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
|
||||
{
|
||||
if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL &&
|
||||
if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != nullptr &&
|
||||
pl_sd->mapindex == m_index &&
|
||||
cd->usersd[0] == pl_sd)
|
||||
{
|
||||
@@ -4843,8 +4843,8 @@ ACMD_FUNC(partyspy)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((p = party_searchname(party_name)) != NULL || // name first to avoid error when name begin with a number
|
||||
(p = party_search(atoi(message))) != NULL) {
|
||||
if ((p = party_searchname(party_name)) != nullptr || // name first to avoid error when name begin with a number
|
||||
(p = party_search(atoi(message))) != nullptr) {
|
||||
if (sd->partyspy == p->party.party_id) {
|
||||
sd->partyspy = 0;
|
||||
sprintf(atcmd_output, msg_txt(sd,105), p->party.name); // No longer spying on the %s party.
|
||||
@@ -4880,8 +4880,8 @@ ACMD_FUNC(clanspy){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((c = clan_searchname(clan_name)) != NULL || // name first to avoid error when name begin with a number
|
||||
(c = clan_search(atoi(message))) != NULL) {
|
||||
if ((c = clan_searchname(clan_name)) != nullptr || // name first to avoid error when name begin with a number
|
||||
(c = clan_search(atoi(message))) != nullptr) {
|
||||
if (sd->clanspy == c->id) {
|
||||
sd->clanspy = 0;
|
||||
sprintf(atcmd_output, msg_txt(sd, 1500), c->name); // No longer spying on the %s clan.
|
||||
@@ -4945,7 +4945,7 @@ ACMD_FUNC(nuke)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) != NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) != nullptr) {
|
||||
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level
|
||||
skill_castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0);
|
||||
clif_displaymessage(fd, msg_txt(sd,109)); // Player has been nuked!
|
||||
@@ -4978,7 +4978,7 @@ ACMD_FUNC(tonpc)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((nd = npc_name2id(npcname)) != NULL) {
|
||||
if ((nd = npc_name2id(npcname)) != nullptr) {
|
||||
if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == SETPOS_OK)
|
||||
clif_displaymessage(fd, msg_txt(sd,0)); // Warped.
|
||||
else
|
||||
@@ -5080,7 +5080,7 @@ ACMD_FUNC(unloadnpc)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((nd = npc_name2id(NPCname)) == NULL) {
|
||||
if ((nd = npc_name2id(NPCname)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist.
|
||||
return -1;
|
||||
}
|
||||
@@ -5138,21 +5138,21 @@ char* txt_time(t_tick duration_)
|
||||
seconds = duration - (60 * minutes);
|
||||
|
||||
if (days == 1)
|
||||
sprintf(temp, msg_txt(NULL,219), days); // %d day
|
||||
sprintf(temp, msg_txt(nullptr,219), days); // %d day
|
||||
else if (days > 1)
|
||||
sprintf(temp, msg_txt(NULL,220), days); // %d days
|
||||
sprintf(temp, msg_txt(nullptr,220), days); // %d days
|
||||
if (hours == 1)
|
||||
sprintf(temp1, msg_txt(NULL,221), temp, hours); // %s %d hour
|
||||
sprintf(temp1, msg_txt(nullptr,221), temp, hours); // %s %d hour
|
||||
else if (hours > 1)
|
||||
sprintf(temp1, msg_txt(NULL,222), temp, hours); // %s %d hours
|
||||
sprintf(temp1, msg_txt(nullptr,222), temp, hours); // %s %d hours
|
||||
if (minutes < 2)
|
||||
sprintf(temp, msg_txt(NULL,223), temp1, minutes); // %s %d minute
|
||||
sprintf(temp, msg_txt(nullptr,223), temp1, minutes); // %s %d minute
|
||||
else
|
||||
sprintf(temp, msg_txt(NULL,224), temp1, minutes); // %s %d minutes
|
||||
sprintf(temp, msg_txt(nullptr,224), temp1, minutes); // %s %d minutes
|
||||
if (seconds == 1)
|
||||
sprintf(temp1, msg_txt(NULL,225), temp, seconds); // %s and %d second
|
||||
sprintf(temp1, msg_txt(nullptr,225), temp, seconds); // %s and %d second
|
||||
else if (seconds > 1)
|
||||
sprintf(temp1, msg_txt(NULL,226), temp, seconds); // %s and %d seconds
|
||||
sprintf(temp1, msg_txt(nullptr,226), temp, seconds); // %s and %d seconds
|
||||
|
||||
return temp1;
|
||||
}
|
||||
@@ -5253,7 +5253,7 @@ ACMD_FUNC(jail)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -5289,7 +5289,7 @@ ACMD_FUNC(unjail)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -5337,7 +5337,7 @@ ACMD_FUNC(jailfor) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -5357,7 +5357,7 @@ ACMD_FUNC(jailfor) {
|
||||
} else {
|
||||
int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
|
||||
char timestr[21];
|
||||
time_t now=time(NULL);
|
||||
time_t now=time(nullptr);
|
||||
split_time(jailtime*60,&year,&month,&day,&hour,&minute,&second);
|
||||
sprintf(atcmd_output,msg_txt(sd,402),msg_txt(sd,1137),year,month,day,hour,minute); // %s in jail for %d years, %d months, %d days, %d hours and %d minutes
|
||||
clif_displaymessage(pl_sd->fd, atcmd_output);
|
||||
@@ -5382,7 +5382,7 @@ ACMD_FUNC(jailfor) {
|
||||
ACMD_FUNC(jailtime){
|
||||
int year, month, day, hour, minute, second;
|
||||
char timestr[21];
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
@@ -5433,7 +5433,7 @@ ACMD_FUNC(disguise)
|
||||
if ((id = mobdb_searchname(message)) == 0)
|
||||
{
|
||||
struct npc_data* nd = npc_name2id(message);
|
||||
if (nd != NULL)
|
||||
if (nd != nullptr)
|
||||
id = nd->class_;
|
||||
}
|
||||
}
|
||||
@@ -5515,7 +5515,7 @@ ACMD_FUNC(disguiseguild)
|
||||
} else {
|
||||
if( (id = mobdb_searchname(monster)) == 0 ) {
|
||||
struct npc_data* nd = npc_name2id(monster);
|
||||
if( nd != NULL )
|
||||
if( nd != nullptr )
|
||||
id = nd->class_;
|
||||
}
|
||||
}
|
||||
@@ -5815,7 +5815,7 @@ ACMD_FUNC(npcmove)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((nd = npc_name2id(npc_name)) == NULL)
|
||||
if ((nd = npc_name2id(npc_name)) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist.
|
||||
return -1;
|
||||
@@ -5859,7 +5859,7 @@ ACMD_FUNC(addwarp)
|
||||
}
|
||||
|
||||
nd = npc_add_warp(warpname, sd->bl.m, sd->bl.x, sd->bl.y, 2, 2, m, x, y);
|
||||
if( nd == NULL )
|
||||
if( nd == nullptr )
|
||||
return -1;
|
||||
|
||||
sprintf(atcmd_output, msg_txt(sd,1158), nd->exname); // New warp NPC '%s' created.
|
||||
@@ -5887,7 +5887,7 @@ ACMD_FUNC(follow)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL )
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == nullptr )
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -6101,7 +6101,7 @@ ACMD_FUNC(cleargstorage)
|
||||
}
|
||||
|
||||
gstorage = guild2storage2(sd->status.guild_id);
|
||||
if (gstorage == NULL) { // Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there.
|
||||
if (gstorage == nullptr) { // Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there.
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -6217,7 +6217,7 @@ ACMD_FUNC(useskill)
|
||||
|
||||
if(!strcmp(atcmd_player_name,"self"))
|
||||
pl_sd = sd; //quick keyword
|
||||
else if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL ){
|
||||
else if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == nullptr ){
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -6342,7 +6342,7 @@ ACMD_FUNC(skilltree)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL )
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == nullptr )
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -6415,7 +6415,7 @@ ACMD_FUNC(marry)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -6513,7 +6513,7 @@ ACMD_FUNC(autotrade) {
|
||||
|
||||
if( battle_config.at_timeout ) {
|
||||
int timeout = atoi(message);
|
||||
status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, SCSTART_NONE);
|
||||
status_change_start(nullptr,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, SCSTART_NONE);
|
||||
}
|
||||
|
||||
if (battle_config.at_logout_event)
|
||||
@@ -6538,7 +6538,7 @@ ACMD_FUNC(changegm)
|
||||
|
||||
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
||||
|
||||
if (sd->status.guild_id == 0 || sd->guild == NULL || strcmp(sd->guild->guild.master,sd->status.name)) {
|
||||
if (sd->status.guild_id == 0 || sd->guild == nullptr || strcmp(sd->guild->guild.master,sd->status.name)) {
|
||||
clif_displaymessage(fd, msg_txt(sd,1181)); // You need to be a Guild Master to use this command.
|
||||
return -1;
|
||||
}
|
||||
@@ -6553,7 +6553,7 @@ ACMD_FUNC(changegm)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,false)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,false)) == nullptr || pl_sd->status.guild_id != sd->status.guild_id) {
|
||||
clif_displaymessage(fd, msg_txt(sd,1184)); // Target character must be online and be a guild member.
|
||||
return -1;
|
||||
}
|
||||
@@ -6567,7 +6567,7 @@ ACMD_FUNC(changegm)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( battle_config.guild_leaderchange_delay && DIFF_TICK(time(NULL),sd->guild->guild.last_leader_change) < battle_config.guild_leaderchange_delay ){
|
||||
if( battle_config.guild_leaderchange_delay && DIFF_TICK(time(nullptr),sd->guild->guild.last_leader_change) < battle_config.guild_leaderchange_delay ){
|
||||
#if PACKETVER >= 20151001
|
||||
clif_msg(sd, GUILD_MASTER_DELAY);
|
||||
#else
|
||||
@@ -6595,7 +6595,7 @@ ACMD_FUNC(changeleader)
|
||||
return -1;
|
||||
}
|
||||
|
||||
party_changeleader(sd, map_nick2sd(atcmd_player_name,false),NULL);
|
||||
party_changeleader(sd, map_nick2sd(atcmd_player_name,false),nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6610,7 +6610,7 @@ ACMD_FUNC(partyoption)
|
||||
char w1[16], w2[16];
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL)
|
||||
if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == nullptr)
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,282)); // You need to be a party leader to use this command.
|
||||
return -1;
|
||||
@@ -7073,7 +7073,7 @@ ACMD_FUNC(sound)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(strstr(sound_file, ".wav") == NULL)
|
||||
if(strstr(sound_file, ".wav") == nullptr)
|
||||
strcat(sound_file, ".wav");
|
||||
|
||||
clif_soundeffect( sd->bl, sound_file, 0, AREA );
|
||||
@@ -7118,7 +7118,7 @@ ACMD_FUNC(mobsearch)
|
||||
for(;;)
|
||||
{
|
||||
TBL_MOB* md = (TBL_MOB*)mapit_next(it);
|
||||
if( md == NULL )
|
||||
if( md == nullptr )
|
||||
break;// no more mobs
|
||||
|
||||
if( md->bl.m != sd->bl.m )
|
||||
@@ -7261,11 +7261,11 @@ ACMD_FUNC(pettalk)
|
||||
if( i == ET_DICE1 ) i = rnd_value<int>(ET_DICE1, ET_DICE6); // randomize /dice
|
||||
if( i < ARRAYLENGTH(emo) )
|
||||
{
|
||||
if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second
|
||||
sd->emotionlasttime = time(NULL);
|
||||
if (sd->emotionlasttime + 1 >= time(nullptr)) { // not more than 1 per second
|
||||
sd->emotionlasttime = time(nullptr);
|
||||
return 0;
|
||||
}
|
||||
sd->emotionlasttime = time(NULL);
|
||||
sd->emotionlasttime = time(nullptr);
|
||||
|
||||
clif_emotion(&pd->bl, i);
|
||||
return 0;
|
||||
@@ -7296,7 +7296,7 @@ ACMD_FUNC(users)
|
||||
for(;;)
|
||||
{
|
||||
map_session_data* sd2 = (map_session_data*)mapit_next(iter);
|
||||
if( sd2 == NULL )
|
||||
if( sd2 == nullptr )
|
||||
break;// no more users
|
||||
|
||||
if( sd2->mapindex >= MAX_MAPINDEX )
|
||||
@@ -7378,7 +7378,7 @@ ACMD_FUNC(summon)
|
||||
md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0);
|
||||
clif_specialeffect(&md->bl,EF_ENTRY2,AREA);
|
||||
mob_spawn(md);
|
||||
sc_start4(NULL,&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
|
||||
sc_start4(nullptr,&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
|
||||
clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick);
|
||||
clif_displaymessage(fd, msg_txt(sd,39)); // All monster summoned!
|
||||
|
||||
@@ -7428,7 +7428,7 @@ ACMD_FUNC(trade)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL )
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == nullptr )
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -7482,7 +7482,7 @@ ACMD_FUNC(unmute)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL )
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr )
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -7581,7 +7581,7 @@ ACMD_FUNC(mute)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL )
|
||||
if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr )
|
||||
{
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
@@ -7598,7 +7598,7 @@ ACMD_FUNC(mute)
|
||||
|
||||
if( pl_sd->status.manner < manner ) {
|
||||
pl_sd->status.manner -= manner;
|
||||
sc_start(NULL,&pl_sd->bl,SC_NOCHAT,100,0,0);
|
||||
sc_start(nullptr,&pl_sd->bl,SC_NOCHAT,100,0,0);
|
||||
} else {
|
||||
pl_sd->status.manner = 0;
|
||||
status_change_end(&pl_sd->bl, SC_NOCHAT);
|
||||
@@ -7674,7 +7674,7 @@ ACMD_FUNC(gmotd)
|
||||
{
|
||||
FILE* fp;
|
||||
|
||||
if( ( fp = fopen(motd_txt, "r") ) != NULL )
|
||||
if( ( fp = fopen(motd_txt, "r") ) != nullptr )
|
||||
{
|
||||
char buf[CHAT_SIZE_MAX];
|
||||
size_t len;
|
||||
@@ -7930,7 +7930,7 @@ ACMD_FUNC(showmobs)
|
||||
for(;;)
|
||||
{
|
||||
TBL_MOB* md = (TBL_MOB*)mapit_next(it);
|
||||
if( md == NULL )
|
||||
if( md == nullptr )
|
||||
break;// no more mobs
|
||||
|
||||
if( md->bl.m != sd->bl.m )
|
||||
@@ -8309,7 +8309,7 @@ ACMD_FUNC(iteminfo)
|
||||
sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s' (%u) Type: %s | Extra Effect: %s
|
||||
item_data->name.c_str(), item_db.create_item_link( item_data ).c_str(),item_data->nameid,
|
||||
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((e_ammo_type)item_data->subtype),
|
||||
(item_data->script==NULL)? msg_txt(sd,1278) : msg_txt(sd,1279) // None / With script
|
||||
(item_data->script==nullptr)? msg_txt(sd,1278) : msg_txt(sd,1279) // None / With script
|
||||
);
|
||||
clif_displaymessage(fd, atcmd_output);
|
||||
|
||||
@@ -8468,7 +8468,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
|
||||
|
||||
int time, id;
|
||||
map_session_data *pl_sd = (map_session_data *)bl;
|
||||
if (pl_sd == NULL)
|
||||
if (pl_sd == nullptr)
|
||||
return 0;
|
||||
|
||||
id = va_arg(ap, int);
|
||||
@@ -8477,7 +8477,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
|
||||
if (id != bl->id && !pc_get_group_level(pl_sd)) {
|
||||
pl_sd->status.manner -= time;
|
||||
if (pl_sd->status.manner < 0)
|
||||
sc_start(NULL,&pl_sd->bl,SC_NOCHAT,100,0,0);
|
||||
sc_start(nullptr,&pl_sd->bl,SC_NOCHAT,100,0,0);
|
||||
else
|
||||
status_change_end(&pl_sd->bl, SC_NOCHAT);
|
||||
}
|
||||
@@ -8865,7 +8865,7 @@ ACMD_FUNC(showdelay)
|
||||
ACMD_FUNC(invite)
|
||||
{
|
||||
unsigned int did = sd->duel_group;
|
||||
map_session_data *target_sd = NULL;
|
||||
map_session_data *target_sd = nullptr;
|
||||
|
||||
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
||||
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
||||
@@ -8886,7 +8886,7 @@ ACMD_FUNC(invite)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((target_sd = map_nick2sd(atcmd_player_name, true)) == NULL) {
|
||||
if((target_sd = map_nick2sd(atcmd_player_name, true)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,352)); // "Duel: Player not found."
|
||||
return 0;
|
||||
}
|
||||
@@ -8937,7 +8937,7 @@ ACMD_FUNC(duel)
|
||||
}
|
||||
duel_create(sd, maxpl);
|
||||
} else {
|
||||
map_session_data *target_sd = NULL;
|
||||
map_session_data *target_sd = nullptr;
|
||||
|
||||
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
||||
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
||||
@@ -8950,7 +8950,7 @@ ACMD_FUNC(duel)
|
||||
|
||||
target_sd = map_nick2sd(atcmd_player_name,true);
|
||||
|
||||
if(target_sd != NULL) {
|
||||
if(target_sd != nullptr) {
|
||||
unsigned int newduel;
|
||||
if((newduel = duel_create(sd, 2)) != -1) {
|
||||
if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
|
||||
@@ -9094,7 +9094,7 @@ ACMD_FUNC(cash)
|
||||
ACMD_FUNC(clone)
|
||||
{
|
||||
int x=0,y=0,flag=0,master=0,i=0;
|
||||
map_session_data *pl_sd=NULL;
|
||||
map_session_data *pl_sd=nullptr;
|
||||
|
||||
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
||||
|
||||
@@ -9103,7 +9103,7 @@ ACMD_FUNC(clone)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) {
|
||||
if((pl_sd=map_nick2sd(atcmd_player_name,true)) == nullptr && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return 0;
|
||||
}
|
||||
@@ -9497,7 +9497,7 @@ ACMD_FUNC(stats)
|
||||
int value;
|
||||
} output_table[] = {
|
||||
{ "Base Level - %d", 0 },
|
||||
{ NULL, 0 },
|
||||
{ nullptr, 0 },
|
||||
{ "Hp - %d", 0 },
|
||||
{ "MaxHp - %d", 0 },
|
||||
{ "Sp - %d", 0 },
|
||||
@@ -9523,7 +9523,7 @@ ACMD_FUNC(stats)
|
||||
{ "JobChangeLvl (2nd) - %d", 0 },
|
||||
{ "JobChangeLvl (3rd) - %d", 0 },
|
||||
{ "JobChangeLvl (4th) - %d", 0 },
|
||||
{ NULL, 0 }
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
memset(job_jobname, '\0', sizeof(job_jobname));
|
||||
@@ -9564,7 +9564,7 @@ ACMD_FUNC(stats)
|
||||
|
||||
clif_displaymessage(fd, output);
|
||||
|
||||
for (i = 0; output_table[i].format != NULL; i++) {
|
||||
for (i = 0; output_table[i].format != nullptr; i++) {
|
||||
sprintf(output, output_table[i].format, output_table[i].value);
|
||||
clif_displaymessage(fd, output);
|
||||
}
|
||||
@@ -9773,7 +9773,7 @@ ACMD_FUNC(mount2) {
|
||||
clif_displaymessage(sd->fd,msg_txt(sd,1362)); // NOTICE: If you crash with mount your LUA is outdated.
|
||||
if (!sd->sc.getSCE(SC_ALL_RIDING)) {
|
||||
clif_displaymessage(sd->fd,msg_txt(sd,1363)); // You have mounted.
|
||||
sc_start(NULL, &sd->bl, SC_ALL_RIDING, 10000, 1, INFINITE_TICK);
|
||||
sc_start(nullptr, &sd->bl, SC_ALL_RIDING, 10000, 1, INFINITE_TICK);
|
||||
} else {
|
||||
clif_displaymessage(sd->fd,msg_txt(sd,1364)); // You have released your mount.
|
||||
status_change_end(&sd->bl, SC_ALL_RIDING);
|
||||
@@ -9855,9 +9855,9 @@ ACMD_FUNC(set) {
|
||||
// Only set the variable if there is a value for it
|
||||
if( toset >= 2 ){
|
||||
if( is_str ){
|
||||
setd_sub_str( NULL, sd, name, index, val, NULL );
|
||||
setd_sub_str( nullptr, sd, name, index, val, nullptr );
|
||||
}else{
|
||||
setd_sub_num( NULL, sd, name, index, strtoll( val, NULL, 10 ), NULL );
|
||||
setd_sub_num( nullptr, sd, name, index, strtoll( val, nullptr, 10 ), nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9884,7 +9884,7 @@ ACMD_FUNC(set) {
|
||||
break;
|
||||
}
|
||||
|
||||
if( value == NULL || *value == '\0' ){// empty string
|
||||
if( value == nullptr || *value == '\0' ){// empty string
|
||||
sprintf(atcmd_output,msg_txt(sd,1375),reg); // %s is empty
|
||||
}else{
|
||||
sprintf(atcmd_output,msg_txt(sd,1374),reg,value); // %s value is now: %s
|
||||
@@ -10172,11 +10172,11 @@ ACMD_FUNC(channel) {
|
||||
} else if ( strcmpi(key,"kick") == 0 ) {
|
||||
return channel_pckick(sd,sub1,sub2);
|
||||
} else if ( strcmpi(key,"banlist") == 0 ) {
|
||||
return channel_pcban(sd,sub1,NULL,3);
|
||||
return channel_pcban(sd,sub1,nullptr,3);
|
||||
} else if ( strcmpi(key,"unban") == 0 ) {
|
||||
return channel_pcban(sd,sub1,sub2,1);
|
||||
} else if ( strcmpi(key,"unbanall") == 0 ) {
|
||||
return channel_pcban(sd,sub1,NULL,2);
|
||||
return channel_pcban(sd,sub1,nullptr,2);
|
||||
} else {
|
||||
char sub3[CHAN_NAME_LENGTH], sub4[CHAN_NAME_LENGTH];
|
||||
sub3[0] = sub4[0] = '\0';
|
||||
@@ -10261,7 +10261,7 @@ ACMD_FUNC(vip) {
|
||||
map_session_data* pl_sd = nullptr;;
|
||||
char * modif_p;
|
||||
int32 vipdifftime = 0;
|
||||
time_t now=time(NULL);
|
||||
time_t now=time(nullptr);
|
||||
|
||||
nullpo_retr(-1, sd);
|
||||
|
||||
@@ -10282,7 +10282,7 @@ ACMD_FUNC(vip) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -10347,7 +10347,7 @@ ACMD_FUNC(fullstrip) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((tsd=map_nick2sd(atcmd_player_name,false)) == NULL && (tsd=map_id2sd(atoi(atcmd_player_name))) == NULL){
|
||||
if((tsd=map_nick2sd(atcmd_player_name,false)) == nullptr && (tsd=map_id2sd(atoi(atcmd_player_name))) == nullptr){
|
||||
clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -10640,7 +10640,7 @@ ACMD_FUNC(adopt)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((b_sd = map_nick2sd(atcmd_player_name,false)) == NULL) {
|
||||
if ((b_sd = map_nick2sd(atcmd_player_name,false)) == nullptr) {
|
||||
clif_displaymessage(fd, msg_txt(sd, 3)); // Character not found.
|
||||
return -1;
|
||||
}
|
||||
@@ -10961,11 +10961,11 @@ ACMD_FUNC(setcard)
|
||||
/**
|
||||
* Fills the reference of available commands in atcommand DBMap
|
||||
**/
|
||||
#define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL, 0 }
|
||||
#define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL, 0 }
|
||||
#define ACMD_DEF(x) { #x, atcommand_ ## x, nullptr, nullptr, 0 }
|
||||
#define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, nullptr, nullptr, 0 }
|
||||
// Define with restriction
|
||||
#define ACMD_DEFR(x, r) { #x, atcommand_ ## x, NULL, NULL, r }
|
||||
#define ACMD_DEF2R(x2, x, r) { x2, atcommand_ ## x, NULL, NULL, r }
|
||||
#define ACMD_DEFR(x, r) { #x, atcommand_ ## x, nullptr, nullptr, r }
|
||||
#define ACMD_DEF2R(x2, x, r) { x2, atcommand_ ## x, nullptr, nullptr, r }
|
||||
void atcommand_basecommands(void) {
|
||||
/**
|
||||
* Command reference list, place the base of your commands here
|
||||
@@ -11314,13 +11314,13 @@ static AtCommandInfo* get_atcommandinfo_byname(const char *name)
|
||||
{
|
||||
if (strdb_exists(atcommand_db, name))
|
||||
return (AtCommandInfo*)strdb_get(atcommand_db, name);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// AtCommand suggestion
|
||||
static void atcommand_get_suggestions(map_session_data* sd, const char *name, bool atcommand) {
|
||||
DBIterator* atcommand_iter;
|
||||
AtCommandInfo* command_info = NULL;
|
||||
AtCommandInfo* command_info = nullptr;
|
||||
AtCommandType type = atcommand ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND;
|
||||
char* full_match[MAX_SUGGESTIONS];
|
||||
char* suggestions[MAX_SUGGESTIONS];
|
||||
@@ -11341,7 +11341,7 @@ static void atcommand_get_suggestions(map_session_data* sd, const char *name, bo
|
||||
suggestions[prefix_count] = command_info->command;
|
||||
++prefix_count;
|
||||
}
|
||||
if ( full_count < MAX_SUGGESTIONS && match != NULL && match != command_info->command && can_use ) {
|
||||
if ( full_count < MAX_SUGGESTIONS && match != nullptr && match != command_info->command && can_use ) {
|
||||
full_match[full_count] = command_info->command;
|
||||
++full_count;
|
||||
}
|
||||
@@ -11361,7 +11361,7 @@ static void atcommand_get_suggestions(map_session_data* sd, const char *name, bo
|
||||
++prefix_count;
|
||||
}
|
||||
|
||||
if( full_count < MAX_SUGGESTIONS && match != NULL && match != alias ){
|
||||
if( full_count < MAX_SUGGESTIONS && match != nullptr && match != alias ){
|
||||
full_match[full_count] = alias;
|
||||
++full_count;
|
||||
}
|
||||
@@ -11413,7 +11413,7 @@ bool is_atcommand(const int fd, map_session_data* sd, const char* message, int t
|
||||
//Reconstructed message
|
||||
char atcmd_msg[CHAT_SIZE_MAX * 2];
|
||||
|
||||
TBL_PC * ssd = NULL; //sd for target
|
||||
TBL_PC * ssd = nullptr; //sd for target
|
||||
AtCommandInfo * info;
|
||||
|
||||
bool is_atcommand = true; // false if it's a charcommand
|
||||
@@ -11478,7 +11478,7 @@ bool is_atcommand(const int fd, map_session_data* sd, const char* message, int t
|
||||
}
|
||||
|
||||
ssd = map_nick2sd(charname,true);
|
||||
if (ssd == NULL) {
|
||||
if (ssd == nullptr) {
|
||||
sprintf(output, msg_txt(sd,1389), command); // %s failed. Player not found.
|
||||
clif_displaymessage(fd, output);
|
||||
return true;
|
||||
@@ -11515,8 +11515,8 @@ bool is_atcommand(const int fd, map_session_data* sd, const char* message, int t
|
||||
if((type == 1 || type == 3) && atcmd_binding_count > 0) {
|
||||
struct atcmd_binding_data *binding = get_atcommandbind_byname(command);
|
||||
|
||||
// Check if the binding isn't NULL and there is a NPC event, level of usage met, et cetera
|
||||
if( binding != NULL && binding->npc_event[0] &&
|
||||
// Check if the binding isn't nullptr and there is a NPC event, level of usage met, et cetera
|
||||
if( binding != nullptr && binding->npc_event[0] &&
|
||||
((is_atcommand && pc_get_group_level(sd) >= binding->level) ||
|
||||
(!is_atcommand && pc_get_group_level(sd) >= binding->level2)))
|
||||
{
|
||||
@@ -11528,7 +11528,7 @@ bool is_atcommand(const int fd, map_session_data* sd, const char* message, int t
|
||||
|
||||
//Grab the command information and check for the proper GM level required to use it or if the command exists
|
||||
info = get_atcommandinfo_byname(atcommand_alias_db.checkAlias(command + 1));
|
||||
if (info == NULL) {
|
||||
if (info == nullptr) {
|
||||
if (pc_get_group_level(sd) == 0) // TODO: remove or replace with proper permission
|
||||
return false;
|
||||
|
||||
@@ -11594,7 +11594,7 @@ void atcommand_db_load_groups(){
|
||||
}
|
||||
void atcommand_db_clear(void) {
|
||||
|
||||
if (atcommand_db != NULL) {
|
||||
if (atcommand_db != nullptr) {
|
||||
DBIterator *iter = db_iterator(atcommand_db);
|
||||
AtCommandInfo* cmd;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user