Pages: 1
Author Topic: 2 Bugs I Found  (32,191 Views)
Offline (Unknown gender) Izackrp

Member
Joined: Mar 2009
Posts: 3
View profile
Posted on: March 18, 2009, 01:49:05 PM
Arrays can not take some expressions
Example:
if (objstatus.bar[argument0-1]<1)
{
    objstatus.bar[argument0-1]=100;
    objstatus.increment[argument0-1]=(100/argument1)/30;
}


Solution:
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:
if (instance_find(objfarm,i).owner==2)
{
   target = varif;
}


Solution:
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
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #1 Posted on: March 18, 2009, 09:11:53 PM
#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.
Pages: 1