The Dink Network

Reply to Re: projectile script

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
November 21st 2005, 12:40 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
It's indeed true that some parts of the script will never be executed.. but on the other hand, it only has to check values of a four integers.. the performance increase by removing then is very very minimal (aka not noticable). On the other hand, yes; strictly you'd need to remove them as it would increase the readability of the script(most important thing) and filesize but that's less of an issue.

Edit: now that I think of it, it could cause a bug because it uses the value of this line:

&mydir = sp_dir(1, -1);

to do the code depending on Dink's direction yet his actual direction changes that:

if (sp_dir(1, -1) == 1)
sp_dir(1, 4);
if (sp_dir(1, -1) == 3)
sp_dir(1, 6);
if (sp_dir(1, -1) == 7)
sp_dir(1, 4);
if (sp_dir(1, -1) == 9)
sp_dir(1, 6);

Of course, it could be that you can get away with it, I haven't checked the script in detail for all if-statements

Edit II: it doesn't.