Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 19.03.2006, 01:03   #1
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default [AI.obj] unknown code

i was working on ai.obj when i saw this code, and this isn't just the only one i found :?

Code:
	shift_sp 1
	push_event	//  c1
	push_const 276
	add
	fetch_i
	push_const 1427
	func_call 81	//  func[OwnItemCount]
	shift_sp -2
	push_const 20
	less
	branch_false L7347
L7346
	push_const 1
	branch_false L7349
L7348
	push_event	//  c1
	push_const 276
	add
	fetch_i	//  quest_last_reward_time
	push_const 644
	add
	push_reg_sp
	fetch_i
	shift_sp 1
	func_call 23	//  func[GetCurrentTick]
	assign
	shift_sp -1
what i don't get is the second part

Code:
L7346
	push_const 1
	branch_false L7349
L7348
Sauron is offline  
Old 19.03.2006, 01:06   #2
SoaPy
Архивный участник
 
Join Date: Feb 2005
Posts: 705
Default

too weird :S
SoaPy is offline  
Old 19.03.2006, 01:20   #3
Xellos
Архивный участник
 
Join Date: Feb 2006
Posts: 88
Default

that's not weird...

it's a simple
Code:
if (true) {
   do something
}
it's in some AIs
and one of the results of some code realigns like the introduction of the TimerEx events and the .top_desire_target (just compare the decompiler output with the old source and u will see some more strange things :P )
Xellos is offline  
Old 19.03.2006, 01:38   #4
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

well i still don't get it, what does that push_const 1 do? if(1) ????

Code:
if(OwnItemCount(c1, @nectar) < 20)
{
 /*
       push_const 1  <---- ??
       branch_false L7349 <---- ??
       
 */
c1.quest_last_reward_time = GetCurrentTick();
Sauron is offline  
Old 19.03.2006, 01:44   #5
Xellos
Архивный участник
 
Join Date: Feb 2006
Posts: 88
Default

yes,

if (1) = if (true)

in the pre c1 AI there was a check that was removed...
some lazy programmer simply changed the expression inside the macro to 1
Xellos is offline  
Old 19.03.2006, 01:59   #6
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

thx
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:37.