Browse Source

Merge pull request #806 from qndel/OperateWeaponRack

OperateWeaponRack almost bin exact?
pull/78/head
Robin Eklind 7 years ago committed by GitHub
parent
commit
47ebd2a8d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 77
      Source/objects.cpp
  2. 2
      Source/objects.h

77
Source/objects.cpp

@ -4473,61 +4473,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 ITYPE_BOW-1:
if (!v7) { weaponType = ITYPE_BOW;
v13 = ITYPE_AXE; break;
goto LABEL_7; case ITYPE_AXE-1:
} weaponType = ITYPE_AXE;
v8 = v7 - 1; break;
if (!v8) { case ITYPE_MACE-1:
v13 = ITYPE_BOW; weaponType = ITYPE_MACE;
goto LABEL_7; break;
} case ITYPE_SWORD-1:
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;
@ -4834,7 +4811,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