Pages: [1]
  Print  
Author Topic: 2 Bugs I Found  (Read 1333 times)
Offline (Unknown gender) Izackrp
Posted on: March 18, 2009, 08:49:05 AM
Member
Joined: Mar 2009
Posts: 3

View Profile
Arrays can not take some expressions
Example:
Code: [Select]
if (objstatus.bar[argument0-1]<1)
{
    objstatus.bar[argument0-1]=100;
    objstatus.increment[argument0-1]=(100/argument1)/30;
}

Solution:
Code: [Select]
Var=argument0-1;
if (objstatus.bar[Var]<1)
{
    objstatus.bar[Var]=100;
    objstatus.increment[Var]=(100/argument1)/30;
}

Yea even though it is bad programming, its still a bug ;)

Problem #2:
Code: [Select]
if (instance_find(objfarm,i).owner==2)
{
   target = varif;
}

Solution:
Code: [Select]
varif=instance_find(objfarm,i);
varowner=varif.owner;

if (instance_find(objfarm,i).owner==2)
{
   target = varif;
}

They both yield the same error:
Operator expected at this point: Cannot have multiple statements inside parentheses
Logged
Offline (Male) RetroX
Reply #1 Posted on: March 18, 2009, 04:11:53 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
#1: That has been fixed, although the fixed version hasn't been uploaded.

#2: Erm, that is exactly the same code, only with a bit more code on top of the second one.  And the problem I that you're trying to retrieve a variable from a class that is created from a function (instance_find), and it doesn't work currently.  That's something that should be looked into.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Pages: [1]
  Print