Browse Source

Merge pull request #986 from qndel/Obj_Light

Obj_Light bin exact
pull/88/head
Robin Eklind 7 years ago committed by GitHub
parent
commit
4eef9f7f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 62
      Source/objects.cpp

62
Source/objects.cpp

@ -1852,53 +1852,37 @@ void AddObject(int ot, int ox, int oy)
void Obj_Light(int i, int lr) void Obj_Light(int i, int lr)
{ {
int v2; // esi int ox, oy, dx, dy, p, tr;
int v3; // ebx BOOL turnon;
int *v4; // edi
int v5; // ST18_4
int v6; // eax
int r; // [esp+Ch] [ebp-14h]
int x; // [esp+14h] [ebp-Ch]
int y; // [esp+18h] [ebp-8h]
signed int v10; // [esp+1Ch] [ebp-4h]
v2 = i;
r = lr;
if (object[i]._oVar1 != -1) { if (object[i]._oVar1 != -1) {
v10 = 0; ox = object[i]._ox;
x = object[v2]._ox; oy = object[i]._oy;
v3 = lr + 10; tr = lr + 10;
y = object[v2]._oy; turnon = FALSE;
if (lightflag) { if (!lightflag) {
LABEL_15: for (p = 0; p < MAX_PLRS && !turnon; p++) {
if (object[v2]._oVar1 == 1) if (plr[p].plractive) {
AddUnLight(object[v2]._olid); if (currlevel == plr[p].plrlevel) {
object[v2]._oVar1 = 0; dx = abs(plr[p].WorldX - ox);
} else { dy = abs(plr[p].WorldY - oy);
v4 = &plr[0].plrlevel; if (dx < tr && dy < tr)
while (!v10) { turnon = TRUE;
if (*((_BYTE *)v4 - 23)) {
if (currlevel == *v4) {
v5 = abs(v4[1] - x);
v6 = abs(v4[2] - y);
if (v5 < v3 && v6 < v3)
v10 = 1;
} }
} }
v4 += 5430;
if ((signed int)v4 >= (signed int)&plr[4].plrlevel) {
if (!v10)
goto LABEL_15;
break;
}
} }
if (!object[v2]._oVar1) }
object[v2]._olid = AddLight(x, y, r); if (turnon) {
object[v2]._oVar1 = 1; if (!object[i]._oVar1)
object[i]._olid = AddLight(ox, oy, lr);
object[i]._oVar1 = 1;
} else {
if (object[i]._oVar1 == 1)
AddUnLight(object[i]._olid);
object[i]._oVar1 = 0;
} }
} }
} }
// 646A28: using guessed type int lightflag;
void Obj_Circle(int i) void Obj_Circle(int i)
{ {

Loading…
Cancel
Save