Translating comments

This commit is contained in:
VladislavKolosovsky
2015-07-16 01:39:39 +07:00
parent 28e41be6ba
commit 06f42daac4
+63 -64
View File
@@ -86,7 +86,7 @@ itsCar:
jne skip
noCar:
mov eax, 0x49C38B
jmp eax // "Ýòî íè÷åãî íå äàñò."
jmp eax // "This does nothing."
skip:
test eax, eax
jnz end
@@ -100,9 +100,9 @@ end:
static void __declspec(naked) obj_use_power_on_car_hook() {
__asm {
xor eax, eax
cmp ebx, 596 // "Àêêóìóëÿòîð ïîëíîñòüþ çàðÿæåí."?
je skip // Äà
inc eax // "Âû çàðÿæàåòå àâòîìîáèëüíûé àêêóìóëÿòîð."
cmp ebx, 596 // "Battery is fully charged."?
je skip // Yes
inc eax // "You charge the car's battery."
skip:
retn
}
@@ -114,19 +114,19 @@ skip:
static void __declspec(naked) item_d_check_addict_hook() {
__asm {
mov edx, 2 // type = çàâèñèìîñòü
cmp eax, -1 // Åñòü drug_pid?
je skip // Íåò
mov edx, 2 // type = addiction
cmp eax, -1 // Has drug_pid?
je skip // No
xchg ebx, eax // ebx = drug_pid
mov eax, esi // eax = who
call queue_find_first_
loopQueue:
test eax, eax // Åñòü ÷òî â ñïèñêå?
jz end // Íåò
test eax, eax // Has something in the list?
jz end // No
cmp ebx, dword ptr [eax+0x4] // drug_pid == queue_addict.drug_pid?
je end // Åñòü êîíêðåòíàÿ çàâèñèìîñòü
je end // Has specific addiction
mov eax, esi // eax = who
mov edx, 2 // type = çàâèñèìîñòü
mov edx, 2 // type = addiction
call queue_find_next_
jmp loopQueue
skip:
@@ -145,10 +145,10 @@ static void __declspec(naked) remove_jet_addict() {
cmp dword ptr [edx+0x4], PID_JET // queue_addict.drug_pid == PID_JET?
jne end
xor eax, eax
inc eax // Óäàëèòü èç î÷åðåäè
inc eax // Delete from queue
retn
end:
xor eax, eax // Íå òðîãàòü
xor eax, eax // Don't touch
retn
}
}
@@ -156,13 +156,13 @@ end:
static void __declspec(naked) item_d_take_drug_hook() {
__asm {
cmp dword ptr [eax], 0 // queue_addict.init
jne skip // Çàâèñèìîñòü åù¸ íå àêòèâíà
jne skip // Addiction is not active yet
mov edx, PERK_add_jet
mov eax, esi
call perform_withdrawal_end_
skip:
mov dword ptr ds:[_wd_obj], esi
mov eax, 2 // type = çàâèñèìîñòü
mov eax, 2 // type = addiction
mov edx, offset remove_jet_addict
call queue_clear_type_
mov eax, 0x479FD1
@@ -176,7 +176,7 @@ static void __declspec(naked) item_wd_process_hook() {
je itsJet
retn
itsJet:
pop edx // Óíè÷òîæàåì àäðåñ âîçâðàòà
pop edx // Destroying the return address
xor edx, edx // edx=init
mov ecx, dword ptr [ebx+0x4] // ecx=drug_pid
push ecx
@@ -242,7 +242,7 @@ nextArmor:
call inven_worn_
test eax, eax
jz noArmor
and byte ptr [eax+0x27], 0xFB // Ñáðàñûâàåì ôëàã îäåòîé áðîíè
and byte ptr [eax+0x27], 0xFB // Unset the flag of equipped armor
jmp nextArmor
noArmor:
mov eax, esi
@@ -267,10 +267,10 @@ static void __declspec(naked) partyMemberIncLevels_hook() {
loopAddict:
mov eax, dword ptr [edi] // eax = drug pid
call item_d_check_addict_
test eax, eax // Åñòü çàâèñèìîñòü?
jz noAddict // Íåò
test eax, eax // Has addiction?
jz noAddict // No
cmp dword ptr [eax], 0 // queue_addict.init
jne noAddict // Çàâèñèìîñòü åù¸ íå àêòèâíà
jne noAddict // Addiction is not active yet
mov edx, dword ptr [eax+0x8] // queue_addict.perk
mov eax, ebx
call perk_add_effect_
@@ -312,8 +312,8 @@ static void __declspec(naked) invenWieldFunc_hook() {
call item_remove_mult_
nextWeapon:
mov eax, esi
test cl, 0x2 // Ïðàâàÿ ðóêà?
jz leftHand // Íåò
test cl, 0x2 // Right hand?
jz leftHand // No
call inven_right_hand_
jmp removeFlag
leftHand:
@@ -321,10 +321,10 @@ leftHand:
removeFlag:
test eax, eax
jz noWeapon
and byte ptr [eax+0x27], 0xFC // Ñáðàñûâàåì ôëàã îðóæèÿ â ðóêå
and byte ptr [eax+0x27], 0xFC // Unset flag of a weapon in hand
jmp nextWeapon
noWeapon:
or byte ptr [edi+0x27], cl // Óñòàíàâëèâàåì ôëàã îðóæèÿ â ðóêå
or byte ptr [edi+0x27], cl // Set flag of a weapon in hand
xchg esi, eax
mov edx, edi
pop ebx
@@ -377,7 +377,7 @@ noArmor:
test eax, eax
jnz haveWeapon
cmp dword ptr ds:[_dialog_target_is_party], eax
jne end // ýòî ñîáóòûëüíèê
jne end // This is a party member
mov eax, [esp+0x18+0x4]
test eax, eax
jz end
@@ -395,8 +395,8 @@ end:
static void __declspec(naked) barter_attempt_transaction_hook() {
__asm {
call stat_level_ // eax = Ìàêñ. ãðóç
sub eax, WeightOnBody // Ó÷èòûâàåì âåñ îäåòîé íà öåëè áðîíè è îðóæèÿ
call stat_level_ // eax = Max weight
sub eax, WeightOnBody // Accounting for weight of target's equipped armor and weapon
retn
}
}
@@ -413,10 +413,10 @@ static void __declspec(naked) move_inventory_hook() {
static void __declspec(naked) item_add_mult_hook() {
__asm {
call stat_level_ // eax = Ìàêñ. ãðóç
call stat_level_ // eax = Max weight
cmp Looting, 0
je end
sub eax, WeightOnBody // Ó÷èòûâàåì âåñ îäåòîé íà öåëè áðîíè è îðóæèÿ
sub eax, WeightOnBody // Accounting for weight of target's equipped armor and weapon
end:
retn
}
@@ -490,38 +490,38 @@ inRange:
static void __declspec(naked) drop_ammo_into_weapon_hook() {
__asm {
dec esi
test esi, esi // Îäíà êîðîáêà ïàòðîíîâ?
jz skip // Äà
test esi, esi // One box of ammo?
jz skip // Yes
xor esi, esi
// Ëèøíÿÿ ïðîâåðêà íà from_slot, íî ïóñòü áóäåò
// Excess check for from_slot, but leave it be
mov edx, [esp+0x24+4] // from_slot
cmp edx, 1006 // Ðóêè?
jge skip // Äà
cmp edx, 1006 // Hands?
jge skip // Yes
lea edx, [eax+0x2C] // Inventory
mov ecx, [edx] // itemsCount
jcxz skip // èíâåíòàðü ïóñòîé (åù¸ ëèøíÿÿ ïðîâåðêà, íî ïóñòü áóäåò)
jcxz skip // inventory is empty (another excess check, but leave it)
mov edx, [edx+8] // FirstItem
nextItem:
cmp ebp, [edx] // Íàøå îðóæèå?
je foundItem // Äà
add edx, 8 // Ê ñëåäóþùåìó
cmp ebp, [edx] // Our weapon?
je foundItem // Yes
add edx, 8 // Go to the next
loop nextItem
jmp skip // Íàøåãî îðóæèÿ íåò â èíâåíòàðå
jmp skip // Our weapon is not in inventory
foundItem:
cmp dword ptr [edx+4], 1 // Îðóæèå â åäèíñòâåííîì ýêçåìïëÿðå?
jg skip // Íåò
cmp dword ptr [edx+4], 1 // Only one weapon?
jg skip // No
mov edx, [esp+0x24+4] // from_slot
lea edx, [edx-1000]
add edx, [esp+0x40+4+0x24+4] // edx=ïîðÿäêîâûé íîìåð ñëîòà ñ ïàòðîíàìè
cmp ecx, edx // Îðóæèå ïîñëå ïàòðîíîâ?
jg skip // Äà
inc esi // Íåò, íóæíî ìåíÿòü from_slot
add edx, [esp+0x40+4+0x24+4] // edx = ordinal number of slot with ammo
cmp ecx, edx // Weapon is after the ammo?
jg skip // Yes
inc esi // No, need to change from_slot
skip:
mov edx, ebp
call item_remove_mult_
test eax, eax // Óäàëèëè îðóæèå èç èíâåíòàðÿ?
jnz end // Íåò
sub [esp+0x24+4], esi // Äà, êîððåêòèðóåì from_slot
test eax, eax // Have weapon been deleted from inventory?
jnz end // No
sub [esp+0x24+4], esi // Yes, correct from_slot
end:
retn
}
@@ -604,52 +604,51 @@ void BugsInit()
// Check drug addiction fix
//MakeCall(0x47A644, &item_d_check_addict_hook, true);
// Èñïðàâëåíèÿ ñíÿòèÿ çàâèñèìîñòè ê âèíòó ó íïñ ?????????
// Fix for removal of jet addiction from NPCs ?????????
/*MakeCall(0x479FC5, &item_d_take_drug_hook, true);
MakeCall(0x47A3A4, &item_wd_process_hook, false);*/
// Èñïðàâëåíèå ïðîêà÷êè ñòàòîâ ÷åðåç óïîòðåáëåíèå íàðêîòèêîâ ïîñëå çàïèñè-çàãðóçêè
// Fix increasing stats via drug use after save-load
//MakeCall(0x47A243, &item_d_load_hook, false);
// Èñïðàâëåíèå êðàøà ïðè èñïîëüçîâàíèè ñòèìïàêîâ íà æåðòâå ñ ïîñëåäóþùèì âûõîäîì ñ êàðòû
// Fix crash when using stimpak on a victim and then exiting the map
//HookCall(0x4A27E7, &queue_clear_type_hook);
// Ìåðçêèé áàã! Åñëè â èíâåíòàðå ñîïàðòèéöà åñòü áðîíÿ òàêàÿ æå êàê íà í¸ì îäåòà, òî ïðè
// ïîëó÷åíèè óðîâíÿ îí òåðÿåò ÊÁ ðàâíûé çíà÷åíèþ ïîëó÷àåìîìó îò ýòîé áðîíè
// Evil bug! If party member has the same armor type in inventory as currently equipped, then
// on level up he loses Armor Class equal to the one received from this armor
//HookCall(0x495F3B, &partyMemberCopyLevelInfo_hook);
// Èñïðàâëåíèå íåïðàâèëüíûõ ñòàòîâ ïðè ïîëó÷åíèè óðîâíÿ ñîïàðòèéöåì êîãäà îí ïîä íàðêîòèêàìè
// Fix of invalid stats when party member gains a level while being on drugs
//HookCall(0x495D5C, &partyMemberIncLevels_hook);
// 9 îïöèé â äèàëîãîâîì îêíå
// 9 options in a dialogue window
//MakeCall(0x44701C, &gdProcessUpdate_hook, true);
// Èñïðàâëåíèå "Unlimited Ammo bug"
// Fix for "Unlimited Ammo bug"
//HookCall(0x472957, &invenWieldFunc_hook);
// Èñïðàâëåíèå îòîáðàæåíèÿ îòðèöàòåëüíûõ çíà÷åíèé â îêíå íàâûêîâ ("S")
// Fix for negative values in Skilldex window ("S")
//SafeWrite8(0x4AC377, 0x7F); // jg
// Èñïðàâëåíèå îøèáêè íåó÷¸òà âåñà îäåòûõ âåùåé
// Fix for not counting in weight of equipped items
/*MakeCall(0x473B4E, &loot_container_hook, false);
MakeCall(0x47588A, &barter_inventory_hook, false);
HookCall(0x474CB8, &barter_attempt_transaction_hook);
HookCall(0x4742AD, &move_inventory_hook);
HookCall(0x4771B5, &item_add_mult_hook);*/
// Øèðèíà òåêñòà 64, à íå 80
// Text width 64, and not 80
/*SafeWrite8(0x475541, 64);
SafeWrite8(0x475789, 64);*/
// Èñïðàâëåíèå îøèáêè îáðàòíîãî ïîðÿäêà â èíâåíòàðå èãðîêà
// Fix for reverse order error in player's inventory
//MakeCall(0x470EC2, &inven_pickup_hook, true);
// Èñïðàâëåíèå îøèáêè â èíâåíòàðå èãðîêà ñâÿçàííîé ñ IFACE_BAR_MODE=1 èç f2_res.ini, íó
// è îøèáêè îáðàòíîãî ïîðÿäêà
// Fix for error in player's inventory, related to IFACE_BAR_MODE=1 in f2_res.ini, and
// also for reverse order error
//MakeCall(0x47114A, &inven_pickup_hook1, true);
// Èñïðàâëåíèå îøèáêè èñïîëüçîâàíèÿ òîëüêî îäíîé ïà÷êè ïàòðîíîâ êîãäà îðóæèå íàõîäèòñÿ ïåðåä
// ïàòðîíàìè
// Fix for using only one pack of ammo, when the weapon is before the ammo
//HookCall(0x476598, &drop_ammo_into_weapon_hook);
dlog("Applying black skilldex patch.", DL_INIT);