Jump to content
  • 0

Mobinfo atcommand.cpp


Question

Posted

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

2 answers to this question

Recommended Posts

  • 0
Posted
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

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