Textdraw len bug
#1

Hello.

I have a textdraw which updates when the player does something. The problem is, this TXD can reach 1000 strlen.

The bug is the fact that if the length passes the 280 string length, it crashes the client with error:

Код:
SA-MP 0.3c
Exception At Address: 0x45203A6D

Registers:
EAX: 0xFFFF000D	EBX: 0x0F1CFBF9	ECX: 0x0000FFFF	EDX: 0xFFFFFFFF
ESI: 0x4396DB6C	EDI: 0x44360000	EBP: 0x76B17E90	ESP: 0x0022FB5C
EFLAGS: 0x00010212

Stack:
+0000: 0x7974706D   0x007E6E7E   0x6E007E6E   0x0F1C007E
+0010: 0x0071A780   0x0022FB8C   0x44360000   0x4396DB6C
+0020: 0x0F1CFBF9   0x0F1CFBF9   0x0F1CF7F8   0x00000000
+0030: 0x49742400   0xC9742400   0xC9742400   0x49742400
+0040: 0x03F4C095   0x44360000   0x4396DB6C   0x0F1CFBF9
+0050: 0x0F1AF0D0   0x0000000B   0x44A00000   0x3ACCCCCD
+0060: 0x44800000   0x3B124925   0x03F06348   0x0000001A
+0070: 0x00000000   0x03F42C9E   0x0022FBE4   0x68DB97BB
+0080: 0x0022FC00   0x00000000   0x0022FC0C   0x68CC37A5
+0090: 0x08CD0040   0x0022FC00   0x00000000   0x04AFAF00
+00A0: 0x04AFDA3C   0x00000006   0x000002BF   0x00000002
+00B0: 0x00000000   0x04AFAF00   0x00000000   0x0022FC38
+00C0: 0x68CAEDFD   0x04AFAF00   0x00000000   0x00000000
+00D0: 0x00000000   0x00000000   0x00000000   0x000000AF
+00E0: 0x03F5D7AB   0x04AFAF00   0x00000000   0x00000000
+00F0: 0x00000001   0x00000000   0x007FDE41   0x04460F58
+0100: 0x00000000   0x00000000   0x00B7CD98   0x00000000
+0110: 0x000000AF   0x007FE7DC   0x00000000   0x00000000
+0120: 0x00B7CD98   0x0000021B   0x0072859C   0x00000001
+0130: 0x00000000   0x00000005   0x00C80468   0x00000004
+0140: 0x00584954   0x4339504F   0x445D1D38   0x4322AFB1
+0150: 0x445D1D38   0x4339504F   0x44577510   0x4322AFB1
+0160: 0x44577510   0x0022FD04   0x00000376   0x4339504F
+0170: 0x44577510   0x4322AFB1   0x44577510   0x4322AFB1
+0180: 0x445D1D38   0x4339504F   0x445D1D38   0x00588727
+0190: 0x00BAA258   0x432E0000   0x445A4924   0x00000004
+01A0: 0x00000010   0x00588538   0x00000001   0x03F43CF4
+01B0: 0x00000008   0x00585C2C   0x00000008   0x00000001
+01C0: 0x00000000   0x0000001A   0x00000000   0x76B17E90
+01D0: 0x00000000   0x000000AF   0x00000000   0x80000000
+01E0: 0x432E0000   0x445A4924   0x00000000   0x438A0000
+01F0: 0x445A4924   0x40C2EAEA   0xC1EA2CD9   0x447AE32A
+0200: 0x00000000   0x0000001A   0x0058FCE9   0x00000001
+0210: 0x0053E504   0x00000001   0x00000001   0x76B17E90
+0220: 0x0022FD90   0x00000000   0x015946B8   0x00B6F028
+0230: 0x03F92261   0x0000001A   0x00000001   0x00000000
+0240: 0x0053EB17   0x44200000   0x44000000   0x0053ECC2
+0250: 0x00000001   0x00619B71   0x0000001A   0x00000001
+0260: 0x00000001   0x0000000A   0x00748DA0   0x0000001A
+0270: 0x00000001   0x757028F7   0x00000000   0x0022FF88

SCM Op: 0x77E, lDbg: 0

Game Version: US 1.0

State Information: Ped Context: 0
I may state that I use ~n~ to form some kind of list in the textdraw.

Any ideas?
Reply
#2

Please post here you textdraw.

The 1024 is 'not the characters limit', this is problem.
Reply
#3

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Please post here you textdraw.

The 1024 is 'not the characters limit', this is problem.
I would love to post the txd but I don't want to make it public (hope you understand me). I can make an example.

pawn Код:
new str[1000];
format(str,1000,"   ~r~List~w~~n~~n~");
for(new x=0; x!=50;x++)
{
    format(str,sizeof(str),"%sRowBLABLABLABLABLABLABLA%d~n~",str,x);
}
TextDrawSetString(txd,str);
TextDrawShowForPlayer(txd);
I have done many tests and it seems that it crashes between 278 & 289 so it may be 280 the limit.

I hope this can be fixed.
Reply
#4

you could use something like this:
Код:
new str[1000];
format(str,1000,"   ~r~List~w~~n~~n~");
for(new x=0; x!=50;x++)
{
    format(str,sizeof(str),"%sRowBLABLABLABLABLABLABLA%d~n~",str,x);
}
if(strlen(str) <= 280){
TextDrawSetString(txd,str);
TextDrawShowForPlayer(txd);
}
this won't show the textdraw if it is too long... you can change the number to the length which is the highest possible for you..
Reply
#5

50 ~n~ in one textdraw is asking for problems. I have no idea what the symbol limit is, but using it as much as you have will cause crashes.

Код:
if(strlen(str) <= 280){
You could also add better defence to this
Код:
if(strlen(str) <= 280)
{
    format(str, sizeof(str), " ");
}
It's a global textdraw, just split it into more textdraws. Make about 3 and position them so they all line up nicely.
Reply
#6

Quote:
Originally Posted by Rac3r
Посмотреть сообщение
50 ~n~ in one textdraw is asking for problems. I have no idea what the symbol limit is, but using it as much as you have will cause crashes.

Код:
if(strlen(str) <= 280){
You could also add better defence to this
Код:
if(strlen(str) <= 280)
{
    format(str, sizeof(str), " ");
}
It's a global textdraw, just split it into more textdraws. Make about 3 and position them so they all line up nicely.
Why do this if it's a nasty bug and it could be (easily i think) fixed by the dev team.

Btw it was just an example i only use 'n' 9 times and thats not the reason of the crash.
Reply
#7

I'm just bumping this topic because this is a really serious issue.

(has not been fixed in RC7 - atleast it's not written in the changelog)

EDIT: Confirmed, it's still crashing the client if TXD len passes 280.
Reply
#8

Do you use any color tags ? Its a known bug, that color tags used before 255 sign in TD string longer than 255 crash.

No ~r~ ~g~ ~b~ ~p~ etc. ?
Reply
#9

Yes I do use colors and I really need them.

Indeed it's a bug and it NEEDS a urgent fix. It will be deeply appreciated.
Reply
#10

Ok Dont use color tags. Thats it, problem solved.

I already discussed this with Kalcor during 0.3a development and he cant find out solution for this. Its hardcoded limitation in San Andreas. Nothing has to be fixed and if you don't like it, code MP yourself and make it better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)