Compact encoding disabled
#1

I'm currently trying to make a Float's default value -1.
So i know i can use a loop in OnGameModeInit to set it to -1:
pawn Код:
public OnGameModeInit() for(new i = 0; i < MAX_VEHICLES; i ++) Test[i] = -1;
But normally with a variable you can do it this way:
pawn Код:
new
    Float: Test[MAX_VEHICLES] = { -1, ... }
;
Although with a float, that gives warning 213: "tag mismatch".

So therefore i tried using -1.0:
pawn Код:
new
    Float: Test[MAX_VEHICLES] = { -1.0, ... }
;
Which gives warning 232: "output file is written, but with compact encoding disabled".
It makes the AMX file go from 3kb to 10kb, but apart from that, is there any other effects, or anything to worry about?
Reply
#2

hmm it doesn't give me any tag mismatch error while compiling with this :
Код:
new
    Float: Test[MAX_VEHICLES] = { -1, ... }
;
But you can use _: to avoid tag mismatch error with -1 like this :
Quote:

new
Float: Test[MAX_VEHICLES] = { _:-1, ... }
;

Reply
#3

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
hmm it doesn't give me any tag mismatch error while compiling with this :
Код:
new
    Float: Test[MAX_VEHICLES] = { -1, ... }
;
But you can use _: to avoid tag mismatch error with -1 like this :
It gives you a warning (if you use it) & you can't avoid it with _: xD

You must do it like this:

Код:
new Float:Test[MAX_VEHICLES];

public OnGameModeInit()
{
    for(new i; i<sizeof(Test); i++) Test[i] = -1.0;
    return 1;
}
PS: If you want to avoid the warning from this code:

Код:
new Float:Test[MAX_VEHICLES] = { -1.0, ...};
Write this above:

Код:
#pragma compress 0
Greekz
Reply
#4

Indeed _: won't help for this, but as i said, i already know you can use a loop.
And yes while #pragma compress 0 hides the warning, the file size is still larger than normal.

Anyways thanks, but i was just wondering if there were any bad effects having the compact encoding disabled with "-1.0" other than the file being larger.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)