Raised This Month: $51 Target: $400
 12% 

Compiler bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-04-2009 , 06:26   Re: Compiler bug?
Reply With Quote #11

l2r crab.

I didn't say "tagging enums or enum values never accomplishes anything and if you tag your enum values you are horrible and should die." I said tagging his enum values as handles accomplishes nothing.
Fyren is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 05-04-2009 , 18:25   Re: Compiler bug?
Reply With Quote #12

I have found that declaring an array of tagged values, using an enum as the size causes tag mismatch warnings.

Example:
PHP Code:
stock TF2_ClassHealth[TFClassType] = { 0125125200175150300175125125 };
#define TF2_GetClassHealth(%1) TF2_ClassHealth[%1]

//stock Float:TF2_ClassSpeeds[TFClassType] = { 0.0, 400.0, 300.0, 240.0, 280.0, 320.0, 230.0, 300.0, 300.0, 300.0 };
stock Float:TF2_ClassSpeeds[10] = { 0.0400.0300.0240.0280.0320.0230.0300.0300.0300.0 };
#define TF2_GetClassSpeed(%1) TF2_ClassSpeeds[%1]

stock Float:TF2_GetPlayerSpeed(client)
{
    if (
TF2_IsPlayerSlowed(client))
        return 
80.0;
    else
        return 
TF2_GetClassSpeed(TF2_GetPlayerClass(client));

If I used the commented out definition of TF2_ClassSpeeds, using TFClassType as the size, I get a tag mismatch.

However, If I use the constant 10 instead it works fine.
Interestingly, The definition of TFClassHealth works just fine, but being a regular number instead of a Float, has no tag.

This appears to be bug #1936

Last edited by naris; 05-04-2009 at 18:30.
naris is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode