Some random cleaning

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12141 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2008-01-26 09:44:10 +00:00
parent ac123d2304
commit c53f4f1955
10 changed files with 44 additions and 75 deletions

View File

@ -114,9 +114,9 @@ geffen,193,152,4 shop Pet Groomer#gef 124,537:-1,643:-1,10013:-1,10014:-1
//======================================================= //=======================================================
// Gonryun // Gonryun
//======================================================= //=======================================================
gonryun,147,84,5 shop Tool Dealer 777,1750:-1,1770:-1,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1 gonryun,147,84,5 shop Tool Dealer#gon 777,1750:-1,1770:-1,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1
gonryun,174,101,3 shop Weapon Dealer 774,1207:-1,1216:-1,1107:-1,1122:-1,1116:-1,1154:-1,1407:-1,1457:-1,1354:-1,1519:-1 gonryun,174,101,3 shop Weapon Dealer#gon 774,1207:-1,1216:-1,1107:-1,1122:-1,1116:-1,1154:-1,1407:-1,1457:-1,1354:-1,1519:-1
gonryun,173,84,3 shop Armor Dealer 770,2211:-1,2401:-1,2403:-1,2501:-1,2503:-1,2101:-1,2103:-1,2305:-1,2321:-1,2332:-1,2328:-1,2627:-1 gonryun,173,84,3 shop Armor Dealer#gon 770,2211:-1,2401:-1,2403:-1,2501:-1,2503:-1,2101:-1,2103:-1,2305:-1,2321:-1,2332:-1,2328:-1,2627:-1
//======================================================= //=======================================================
// Hugel // Hugel
@ -136,7 +136,7 @@ izlude_in,60,127,4 shop Weapon Dealer#iz 72,1750:-1,1751:-1,1701:-1,1601:-1,1201
izlude_in,70,127,4 shop Armor Dealer#iz 62,2103:-1,2105:-1,2403:-1,2405:-1,2503:-1,2505:-1,2226:-1,2228:-1,2303:-1,2305:-1,2328:-1,2307:-1,2309:-1,2312:-1,2314:-1,2316:-1,2628:-1 izlude_in,70,127,4 shop Armor Dealer#iz 62,2103:-1,2105:-1,2403:-1,2405:-1,2503:-1,2505:-1,2226:-1,2228:-1,2303:-1,2305:-1,2328:-1,2307:-1,2309:-1,2312:-1,2314:-1,2316:-1,2628:-1
izlude_in,115,61,0 shop Tool Dealer#iz 47,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1 izlude_in,115,61,0 shop Tool Dealer#iz 47,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1
izlude,105,99,0 shop Butcher#iz 54,517:-1 izlude,105,99,0 shop Butcher#iz 54,517:-1
izlude,94,98,4 shop Fruit Gardene#izr 53,512:-1,513:-1,515:-1,516:-1 izlude,94,98,4 shop Fruit Gardene#iz 53,512:-1,513:-1,515:-1,516:-1
izlude,105,92,7 shop Vendor from Milk Ranch#i 90,519:-1 izlude,105,92,7 shop Vendor from Milk Ranch#i 90,519:-1
izlude,164,138,4 shop Pet Groomer#iz 124,537:-1,643:-1,10013:-1,10014:-1 izlude,164,138,4 shop Pet Groomer#iz 124,537:-1,643:-1,10013:-1,10014:-1

View File

@ -3663,7 +3663,7 @@ int atcommand_kick(const int fd, struct map_session_data* sd, const char* comman
return -1; return -1;
} }
clif_GM_kick(sd, pl_sd, 1); clif_GM_kick(sd, pl_sd);
return 0; return 0;
} }
@ -3682,7 +3682,7 @@ int atcommand_kickall(const int fd, struct map_session_data* sd, const char* com
for (i = 0; i < users; i++) { for (i = 0; i < users; i++) {
if ((pl_sd = pl_allsd[i]) && pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kick only lower or same gm level if ((pl_sd = pl_allsd[i]) && pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kick only lower or same gm level
if (sd->status.account_id != pl_sd->status.account_id) if (sd->status.account_id != pl_sd->status.account_id)
clif_GM_kick(sd, pl_sd, 0); clif_GM_kick(NULL, pl_sd);
} }
} }
@ -3899,9 +3899,9 @@ int atcommand_mapexit(const int fd, struct map_session_data* sd, const char* com
pl_allsd = map_getallusers(&users); pl_allsd = map_getallusers(&users);
for (i = 0; i < users; i++) { for (i = 0; i < users; i++) {
if ((pl_sd = pl_allsd[i]) && sd->status.account_id != pl_sd->status.account_id) if ((pl_sd = pl_allsd[i]) && sd->status.account_id != pl_sd->status.account_id)
clif_GM_kick(sd, pl_sd, 0); clif_GM_kick(NULL, pl_sd);
} }
clif_GM_kick(sd, sd, 0); clif_GM_kick(NULL, sd);
flush_fifos(); flush_fifos();

View File

@ -3434,9 +3434,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
TBL_PC* tsd = (TBL_PC*)bl; TBL_PC* tsd = (TBL_PC*)bl;
clif_getareachar_pc(sd, tsd); clif_getareachar_pc(sd, tsd);
if(tsd->state.size==2) // tiny/big players [Valaris] if(tsd->state.size==2) // tiny/big players [Valaris]
clif_specialeffect_single(bl, 423, sd->fd); clif_specialeffect_single(bl,423,sd->fd);
else if(tsd->state.size==1) else if(tsd->state.size==1)
clif_specialeffect_single(bl, 421, sd->fd); clif_specialeffect_single(bl,421,sd->fd);
} }
break; break;
case BL_NPC: case BL_NPC:
@ -3450,9 +3450,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
{ {
TBL_MOB* md = (TBL_MOB*)bl; TBL_MOB* md = (TBL_MOB*)bl;
if(md->special_state.size==2) // tiny/big mobs [Valaris] if(md->special_state.size==2) // tiny/big mobs [Valaris]
clif_specialeffect_single(bl, 423, sd->fd); clif_specialeffect_single(bl,423,sd->fd);
else if(md->special_state.size==1) else if(md->special_state.size==1)
clif_specialeffect_single(bl, 421, sd->fd); clif_specialeffect_single(bl,421,sd->fd);
} }
break; break;
case BL_PET: case BL_PET:
@ -6880,7 +6880,7 @@ int clif_GM_kickack(struct map_session_data *sd, int id)
return 0; return 0;
} }
int clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd,int type) void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd)
{ {
int fd = tsd->fd; int fd = tsd->fd;
@ -6889,10 +6889,8 @@ int clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd,int ty
else else
map_quit(tsd); map_quit(tsd);
if( type ) if( sd )
clif_GM_kickack(sd,tsd->status.account_id); clif_GM_kickack(sd,tsd->status.account_id);
return 0;
} }
/// Displays various manner-related status messages /// Displays various manner-related status messages
@ -9046,14 +9044,11 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
type = (int)RFIFOW(fd,2); type = (int)RFIFOW(fd,2);
if( (type == 5 && sd->status.base_level <= 90) || if( (type == 5 && sd->status.base_level > 90) ||
(type == 4 && sd->status.base_level <= 80) || (type == 4 && sd->status.base_level > 80) ||
(type == 3 && sd->status.base_level <= 65) || (type == 3 && sd->status.base_level > 65) ||
(type == 2 && sd->status.base_level <= 40) || (type == 2 && sd->status.base_level > 40) )
pc_setcart(sd,type) ) pc_setcart(sd,type);
{
LOG_SUSPICIOUS(sd,"clif_parse_ChangeCart");
}
} }
/*========================================== /*==========================================
@ -9403,7 +9398,7 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
select = RFIFOB(fd,6); select = RFIFOB(fd,6);
if((select > sd->npc_menu && select != 0xff) || !select){ if((select > sd->npc_menu && select != 0xff) || !select){
ShowWarning("Hack on NPC Select Menu: %s (AID: %d)!\n",sd->status.name,sd->bl.id); ShowWarning("Hack on NPC Select Menu: %s (AID: %d)!\n",sd->status.name,sd->bl.id);
clif_GM_kick(sd,sd,0); clif_GM_kick(NULL,sd);
} else { } else {
sd->npc_menu=select; sd->npc_menu=select;
npc_scriptcont(sd,RFIFOL(fd,2)); npc_scriptcont(sd,RFIFOL(fd,2));
@ -10258,7 +10253,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
clif_GM_kickack(sd, 0); clif_GM_kickack(sd, 0);
return; return;
} }
clif_GM_kick(sd, tsd, 1); clif_GM_kick(sd, tsd);
if(log_config.gm && lv >= log_config.gm) { if(log_config.gm && lv >= log_config.gm) {
char message[256]; char message[256];
sprintf(message, "/kick %s (%d)", tsd->status.name, tsd->status.char_id); sprintf(message, "/kick %s (%d)", tsd->status.name, tsd->status.char_id);

View File

@ -362,7 +362,7 @@ void clif_specialeffect_single(struct block_list* bl, int type, int fd);
int clif_message(struct block_list *bl, const char* msg); // messages (from mobs/npcs) [Valaris] int clif_message(struct block_list *bl, const char* msg); // messages (from mobs/npcs) [Valaris]
int clif_GM_kickack(struct map_session_data *sd,int id); int clif_GM_kickack(struct map_session_data *sd,int id);
int clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd,int type); void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd);
void clif_manner_message(struct map_session_data* sd, uint32 type); void clif_manner_message(struct map_session_data* sd, uint32 type);
void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type); void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
int clif_timedout(struct map_session_data *sd); int clif_timedout(struct map_session_data *sd);

View File

@ -1770,17 +1770,19 @@ struct map_session_data** map_getallusers(int *users)
all_count = pc_db->size(pc_db); //This is the real number of chars in the db, better use this than the actual "online" count. all_count = pc_db->size(pc_db); //This is the real number of chars in the db, better use this than the actual "online" count.
if (all_count < 1) if (all_count < 1)
all_count = 10; //Allow room for at least 10 chars. all_count = 10; //Allow room for at least 10 chars.
all_sd = aCalloc(all_count, sizeof(struct map_session_data*)); //it's actually just the size of a pointer. CREATE(all_sd, struct map_session_data*, all_count);
} }
if (all_count < pc_db->size(pc_db)) if (all_count < pc_db->size(pc_db))
{ {
all_count = pc_db->size(pc_db)+10; //Give some room to prevent doing reallocs often. all_count = pc_db->size(pc_db)+10; //Give some room to prevent doing reallocs often.
all_sd = aRealloc(all_sd, all_count*sizeof(struct map_session_data*)); RECREATE(all_sd, struct map_session_data*, all_count);
} }
*users = pc_db->getall(pc_db,(void**)all_sd,all_count,map_getallpc_sub); *users = pc_db->getall(pc_db,(void**)all_sd,all_count,map_getallpc_sub);
if (*users > (signed int)all_count) //Which should be impossible... if (*users > (signed int)all_count) //Which should be impossible...
*users = all_count; *users = all_count;
return all_sd; return all_sd;
} }
@ -1819,18 +1821,18 @@ int map_foreachiddb(int (*func)(DBKey,void*,va_list),...)
int map_addnpc(int m,struct npc_data *nd) int map_addnpc(int m,struct npc_data *nd)
{ {
int i; int i;
if(m<0 || m>=map_num) if( m < 0 || m >= map_num )
return -1; return -1;
for(i=0;i<map[m].npc_num && i<MAX_NPC_PER_MAP;i++)
if(map[m].npc[i]==NULL) ARR_FIND( 0, MAX_NPC_PER_MAP, i, map[m].npc[i] == NULL );
break; if( i == MAX_NPC_PER_MAP )
if(i==MAX_NPC_PER_MAP){ {
ShowWarning("too many NPCs in one map %s\n",map[m].name); ShowWarning("too many NPCs in one map %s\n",map[m].name);
return -1; return -1;
} }
if(i==map[m].npc_num){
if( i == map[m].npc_num )
map[m].npc_num++; map[m].npc_num++;
}
nullpo_retr(0, nd); nullpo_retr(0, nd);
@ -1841,44 +1843,19 @@ int map_addnpc(int m,struct npc_data *nd)
return i; return i;
} }
void map_removenpc(void)
{
int i,m,n=0;
for(m=0;m<map_num;m++) {
for(i=0;i<map[m].npc_num && i<MAX_NPC_PER_MAP;i++) {
if(map[m].npc[i]!=NULL) {
clif_clearunit_area(&map[m].npc[i]->bl,2);
map_delblock(&map[m].npc[i]->bl);
idb_remove(id_db,map[m].npc[i]->bl.id);
if(map[m].npc[i]->subtype==SCRIPT) {
aFree(map[m].npc[i]->u.scr.script);
aFree(map[m].npc[i]->u.scr.label_list);
}
aFree(map[m].npc[i]);
map[m].npc[i] = NULL;
n++;
}
}
}
ShowStatus("Successfully removed and freed from memory '"CL_WHITE"%d"CL_RESET"' NPCs.\n",n);
}
/*========================================= /*=========================================
* Dynamic Mobs [Wizputer] * Dynamic Mobs [Wizputer]
*-----------------------------------------*/ *-----------------------------------------*/
// allocates a struct when it there is place free in the cache, // Stores the spawn data entry in the mob list.
// and returns NULL otherwise // Returns the index of successful, or -1 if the list was full.
// -- i'll just leave the old code in case it's needed ^^;
int map_addmobtolist(unsigned short m, struct spawn_data *spawn) int map_addmobtolist(unsigned short m, struct spawn_data *spawn)
{ {
size_t i; size_t i;
for (i = 0; i < MAX_MOB_LIST_PER_MAP; i++) { ARR_FIND( 0, MAX_MOB_LIST_PER_MAP, i, map[m].moblist[i] == NULL );
if (map[m].moblist[i] == NULL) { if( i < MAX_MOB_LIST_PER_MAP )
map[m].moblist[i] = spawn; {
return i; map[m].moblist[i] = spawn;
} return i;
} }
return -1; return -1;
} }

View File

@ -503,9 +503,6 @@ struct homunculus_db; //[orn]
struct item_data; struct item_data;
struct square; struct square;
// The player performed a suspicious action (not used right now) [FlavioJS]
#define LOG_SUSPICIOUS(sd,msg)
struct map_session_data { struct map_session_data {
struct block_list bl; struct block_list bl;
struct unit_data ud; struct unit_data ud;