Browse Source

OperateWeaponRack almost bin exact?

pull/78/head
qndel 7 years ago
parent
commit
dbbd6f2700
  1. 83
      Source/objects.cpp
  2. 2
      Source/objects.h

83
Source/objects.cpp

@ -1699,9 +1699,9 @@ void __fastcall AddPurifyingFountain(int i)
ox = object[i]._ox; ox = object[i]._ox;
oy = object[i]._oy; oy = object[i]._oy;
dObject[ox][oy-1] = -1 - i; dObject[ox][oy - 1] = -1 - i;
dObject[ox-1][oy] = -1 - i; dObject[ox - 1][oy] = -1 - i;
dObject[ox-1][oy - 1] = -1 - i; dObject[ox - 1][oy - 1] = -1 - i;
object[i]._oRndSeed = GetRndSeed(); object[i]._oRndSeed = GetRndSeed();
} }
@ -4586,61 +4586,38 @@ BOOLEAN __fastcall OperateFountains(int pnum, int i)
// 52571C: using guessed type int drawpanflag; // 52571C: using guessed type int drawpanflag;
// 676190: using guessed type int deltaload; // 676190: using guessed type int deltaload;
void __fastcall OperateWeaponRack(int pnum, int i, unsigned char sendmsg) void __fastcall OperateWeaponRack(int pnum, int i, BOOL sendmsg)
{ {
unsigned short v3; // di int weaponType;
int v4; // esi
int v6; // eax
int v7; // eax
int v8; // eax
int v9; // eax
BOOLEAN v10; // zf
int v11; // ecx
int v12; // edx
signed int v13; // [esp-4h] [ebp-14h]
int v14; // [esp+Ch] [ebp-4h]
v3 = i;
v4 = i;
v14 = pnum;
if (!object[i]._oSelFlag) if (!object[i]._oSelFlag)
return; return;
SetRndSeed(object[v4]._oRndSeed); SetRndSeed(object[i]._oRndSeed);
v6 = random(0, 4);
if (v6) { switch (random(0, 4)) {
v7 = v6 - 1; case 2:
if (!v7) { weaponType = ITYPE_BOW;
v13 = ITYPE_AXE; break;
goto LABEL_7; case 1:
} weaponType = ITYPE_AXE;
v8 = v7 - 1; break;
if (!v8) { case 3:
v13 = ITYPE_BOW; weaponType = ITYPE_MACE;
goto LABEL_7; break;
} case 0:
if (v8 == 1) { weaponType = ITYPE_SWORD;
v13 = ITYPE_MACE; break;
LABEL_7:
v9 = v13;
goto LABEL_12;
}
v9 = sendmsg;
} else {
v9 = ITYPE_SWORD;
} }
LABEL_12:
++object[v4]._oAnimFrame; object[i]._oAnimFrame++;
v10 = deltaload == 0; object[i]._oSelFlag = 0;
object[v4]._oSelFlag = 0; if (!deltaload) {
if (v10) { if (leveltype > 1)
v11 = object[v4]._ox; CreateTypeItem(object[i]._ox, object[i]._oy, 1, weaponType, 0, sendmsg, 0);
v12 = object[v4]._oy;
if (leveltype <= 1u)
CreateTypeItem(v11, v12, 0, v9, 0, sendmsg, 0);
else else
CreateTypeItem(v11, v12, 1u, v9, 0, sendmsg, 0); CreateTypeItem(object[i]._ox, object[i]._oy, 0, weaponType, 0, sendmsg, 0);
if (v14 == myplr) if (pnum == myplr)
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, v3); NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
} }
} }
// 676190: using guessed type int deltaload; // 676190: using guessed type int deltaload;
@ -4947,7 +4924,7 @@ void __fastcall SyncOpObject(int pnum, int cmd, int i)
break; break;
case OBJ_WARWEAP: case OBJ_WARWEAP:
case OBJ_WEAPONRACK: case OBJ_WEAPONRACK:
OperateWeaponRack(pnum, i, 0); OperateWeaponRack(pnum, i, FALSE);
break; break;
case OBJ_MUSHPATCH: case OBJ_MUSHPATCH:
OperateMushPatch(pnum, i); OperateMushPatch(pnum, i);

2
Source/objects.h

@ -124,7 +124,7 @@ int __fastcall FindValidShrine(int i);
void __fastcall OperateGoatShrine(int pnum, int i, int sType); void __fastcall OperateGoatShrine(int pnum, int i, int sType);
void __fastcall OperateCauldron(int pnum, int i, int sType); void __fastcall OperateCauldron(int pnum, int i, int sType);
BOOLEAN __fastcall OperateFountains(int pnum, int i); BOOLEAN __fastcall OperateFountains(int pnum, int i);
void __fastcall OperateWeaponRack(int pnum, int i, unsigned char sendmsg); void __fastcall OperateWeaponRack(int pnum, int i, BOOL sendmsg);
void __fastcall OperateStoryBook(int pnum, int i); void __fastcall OperateStoryBook(int pnum, int i);
void __fastcall OperateLazStand(int pnum, int i); void __fastcall OperateLazStand(int pnum, int i);
void __fastcall OperateObject(int pnum, int i, BOOL TeleFlag); void __fastcall OperateObject(int pnum, int i, BOOL TeleFlag);

Loading…
Cancel
Save