Jump to content
  • 0

Mobinfo atcommand.cpp


Frozek

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  37
  • Reputation:   0
  • Joined:  10/30/18
  • Last Seen:  

Hello everyone, I'm setting up my server and it will be in Portuguese, I translated the Size, Race and Element of the mobs in atcommand.cpp, but when compiling it gives the following error. Talking to some friends they told me that there are too many letters, but some of them have this file translated and it doesn't give an error, just mine.

image.thumb.png.f2488a7f8bb604dccee560b7e5dd4655.png

 

image.thumb.png.78fdc8c2351afd07a2453290c4a833c2.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   5
  • Joined:  02/22/22
  • Last Seen:  

18 hours ago, Frozek said:

Hello everyone, I'm setting up my server and it will be in Portuguese, I translated the Size, Race and Element of the mobs in atcommand.cpp, but when compiling it gives the following error. Talking to some friends they told me that there are too many letters, but some of them have this file translated and it doesn't give an error, just mine.

image.thumb.png.f2488a7f8bb604dccee560b7e5dd4655.png

 

image.thumb.png.78fdc8c2351afd07a2453290c4a833c2.png

The error message msize: estouro nos limites da matrizindicates that the arraymsizehas been declared to have a second dimension size of 7 characters, but you are trying to initialize it with strings that are potentially longer than 6 characters (remember that you need an extra character for the null terminator\0` in C++ strings).
Similarly, for melement, you're trying to initialize it with strings that might be longer than the declared size once you consider the null terminator.

Now you can try with this code:

unsigned char msize[SZ_ALL][8] = { "Pequeno", "Medio", "Grande" }; // changed from [7] to [8]
unsigned char melement[ELE_ALL][9] = { "Neutro", "Agua", "Terra", "Fogo", "Vento", "Veneno", "Sagrado", "Sombrio", "Fantasma", "Maldito" }; // changed from [8] to [9]

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  37
  • Reputation:   0
  • Joined:  10/30/18
  • Last Seen:  

Thanks bro, you helped me a lot.

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...