Jump to content
  • 0

MvP Respawn Broadcaster - Fix some Console Warnings


Question

Posted

 

Hello I implemented this code to broadcast mvp respawns.

 scr/map/mob.cpp

		md->spawn_timer = INVALID_TIMER;
		mob_spawn(md);

Under this line I placed:

				// if monster boss -> do announce
		if( md->spawn->state.boss ) {
			char message[128];
			sprintf(message, "[MVP Spawn]: %s has been spawned on %s map.", md->name, map_mapid2mapname(md->spawn->m));
			clif_broadcast(&md->bl, message, strlen(message) + 1, BC_DEFAULT, ALL_CLIENT);
		}
	}
	return 0;

It's working fine, MvP Respawns are being broadcasted, but now may I now is there any way to get rid of some console warnings?

1>mob.cpp
1>C:\Users\mario\Desktop\rAthena \src\map\mob.cpp(1049,80): warning C4267: 'argumento': conversión de 'size_t' a 'int'; posible pérdida de datos
1>C:\Users\mario\Desktop\rAthena \src\map\mob.cpp(2839,57): warning C4267: 'argumento': conversión de 'size_t' a 'int'; posible pérdida de datos
1>C:\Users\mario\Desktop\rAthena \src\map\mob.cpp(3009,58): warning C4267: 'argumento': conversión de 'size_t' a 'int'; posible pérdida de datos
1>C:\Users\mario\Desktop\rAthena \src\map\mob.cpp(6410,50): warning C4267: 'inicializando': conversión de 'size_t' a 'int'; posible pérdida de datos
1>C:\Users\mario\Desktop\rAthena \src\map\mob.cpp(6411,65): warning C4267: 'inicializando': conversión de 'size_t' a 'int'; posible pérdida de datos

 

Can you guys lend me a hand?

 

3 answers to this question

Recommended Posts

  • 0
Posted

This should fix the warnings.
 

		if( md->spawn->state.boss ) {
			char message[128];
			sprintf(message, "[MVP Spawn]: %s has been spawned on %s map.", md->name, map_mapid2mapname(md->spawn->m));
			clif_broadcast(&md->bl, message, (int)strlen(message) + 1, BC_DEFAULT, ALL_CLIENT);
		}

 

  • Love 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...