Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 14.07.2007, 14:16   #1
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default ...after decompilation. Stranges in npc

agent_of_slaughter

Code:
If ( 1 != 0 && 1 == 1 )
{
	myself->GiveItem1(target, 7543, 1);
	myself->SoundEffect(target, "ItemSound.quest_itemget");
}
If ( 0 != 0 && 0 == 1 )
{
	myself->GiveItem1(target, 0, 0);
	myself->SoundEffect(target, "ItemSound.quest_itemget");
}
This npc spawn in world, have quest.
But... this code confused me.

- two identical conditions
If ( 0 != 0 && 0 == 1 )
- two strange conditions
If ( 0 != 0 && 0 == 1 ) 0 != 0 and 0 == 1??? Madness...
- GiveItem, id=0, amount 0
what is it? debug code? Horror.

Is very interesting to examine the code in nps. Much interesting it is possible there to find.
HF is offline  
Old 14.07.2007, 14:26   #2
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

Code:
if( 0 != 0 && 1 == 1 )
That one is kind of fun too...

I can only think of debug code or that ncsoft use custom variables when coding the AI.
m4rk is offline  
Old 14.07.2007, 14:29   #3
ateh
Архивный участник
 
Join Date: Apr 2006
Posts: 118
Default

There are hundreds of such examples, like
"myself->GiveItem1(target,0,0);" exists 1170 times in whole AI...
"if ( 1 == 1 )" 476 times
"0 != 0" 2554 times
"0 == 1" 4541 times...
And one might wonder why AI has 140 MB... ;P
Prolly they had some erros in questdata.txt file for nasc.
ateh is offline  
Old 14.07.2007, 17:14   #4
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Well... we need C4Compiler for remade full ai.obj
HF is offline  
Old 14.07.2007, 19:37   #5
Kenjiro
Архивный участник
 
Join Date: Apr 2006
Posts: 120
Default

I suspect this was for error checks from PTS l2npc (maybe it has some weird 'bugs'?).
Or left by previous version as 'backup' code...
Kenjiro is offline  
Old 15.07.2007, 11:34   #6
barabashka
Архивный участник
 
Join Date: Jan 2006
Posts: 55
Default

Quote:
Originally Posted by HF View Post
Well... we need C4Compiler for remade full ai.obj
In Testing...
barabashka is offline  
Old 15.07.2007, 11:36   #7
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by barabashka View Post
In Testing...
php? .net? i want it to test too
HF is offline  
Old 16.07.2007, 14:29   #8
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

that's probably code for future quest.
Sauron is offline  
 


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. The time now is 15:18.