Jump to content
  • 0

MvP Respawn Broadcaster - Fix some Console Warnings


iraciz

Question


  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   108
  • Joined:  10/05/12
  • Last Seen:  

 

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?

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   68
  • Joined:  10/25/20
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   108
  • Joined:  10/05/12
  • Last Seen:  

image.thumb.png.36ef0f0411fb5851aabace370ecf6f68.pngStill getting those warnings, but not harmfull. thankyou

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   86
  • Joined:  04/10/12
  • Last Seen:  

7 hours ago, iraciz said:

image.thumb.png.36ef0f0411fb5851aabace370ecf6f68.pngStill getting those warnings, but not harmfull. thankyou

I think you gotta post more code, specifically those lines that are throwing a warning xd

Link to comment
Share on other sites

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.

×
×
  • Create New...