cheahjs / TerrariaAPI-Server

Fork is now over at https://github.com/NyxStudios/TerrariaAPI-Server
https://tshock.co
32 stars 24 forks source link

Missing code?? #35

Closed d3monfiend closed 10 years ago

d3monfiend commented 10 years ago

I have look up the code and i think the worldgen.cs is missing this one?

public static void paintEffect(int x, int y, byte color, byte oldColor) { int color2 = (int)(color ?? oldColor); <------ I am not sure how to fix this Color newColor = WorldGen.paintColor(color2); for (int i = 0; i < 10; i++) { int num = Dust.NewDust(new Vector2((float)(x * 16), (float)(y * 16)), 16, 16, 143, 0f, 0f, 50, newColor, 1f); if (Main.rand.Next(2) == 0) { Main.dust[num].noGravity = true; Main.dust[num].scale = 1.2f; } else { Main.dust[num].scale = 0.5f; } } }

Olink commented 10 years ago

Did you consider that this is Client Code?

d3monfiend commented 10 years ago

So do you know how to fix (int)(color ?? oldColor); ? The error is Operator '??' cannot be applied to operands of type 'byte' and 'byte'

QuiCM commented 10 years ago

TShock and TerrariaAPI devs are not here to help you decompile a Terraria client, or fix errors you encounter when doing so.

d3monfiend commented 10 years ago

Sorry, but I have already found out how to fix the issue.