![]() |
|
|
#1 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
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 Code:
L7346 push_const 1 branch_false L7349 L7348 |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Feb 2005
Posts: 705
|
too weird :S
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
that's not weird...
it's a simple Code:
if (true) {
do something
}
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 ) |
|
|
|
|
#4 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
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();
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
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 |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
thx
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|