diff --git a/src/info.cpp b/src/info.cpp index 0ff3928cd6..ffae037f74 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -438,6 +438,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill) } // The Replacement field is temporarily NULLed to prevent // potential infinite recursion. + PClassActor *oldrep = ActorInfo()->Replacement; ActorInfo()->Replacement = nullptr; PClassActor *rep = Replacement; // Handle skill-based replacement here. It has precedence on DECORATE replacement @@ -451,7 +452,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill) // Skill replacements are not recursive, contrarily to DECORATE replacements rep = rep->GetReplacement(false); // Reset the temporarily NULLed field - ActorInfo()->Replacement = Replacement; + ActorInfo()->Replacement = oldrep; return rep; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 070745df41..e0ebaea925 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1158,6 +1158,14 @@ AInventory *AActor::DropInventory (AInventory *item, int amt) drop->Vel += Vel; drop->flags &= ~MF_NOGRAVITY; // Don't float drop->ClearCounters(); // do not count for statistics again + { + // [MK] call OnDrop so item can change its drop behaviour + IFVIRTUALPTR(drop, AInventory, OnDrop) + { + VMValue params[] = { drop, this }; + VMCall(func, params, 2, nullptr, 0); + } + } return drop; } diff --git a/src/r_data/models/models_ue1.cpp b/src/r_data/models/models_ue1.cpp index f4392e54b8..838be2af70 100644 --- a/src/r_data/models/models_ue1.cpp +++ b/src/r_data/models/models_ue1.cpp @@ -123,11 +123,14 @@ void FUE1Model::LoadGeometry() // unpack coords for ( int j=0; j<3; j++ ) Poly.C[j] = FVector2(dpolys[i].uv[j][0]/255.f,dpolys[i].uv[j][1]/255.f); - // compute facet normal - FVector3 dir[2]; - dir[0] = verts[Poly.V[1]].Pos-verts[Poly.V[0]].Pos; - dir[1] = verts[Poly.V[2]].Pos-verts[Poly.V[0]].Pos; - Poly.Normal = dir[0]^dir[1]; + // compute facet normals + for ( int j=0; jSet(V.Pos.X,V.Pos.Y,V.Pos.Z,C.X,C.Y); if ( groups[j].type&PT_Curvy ) // use facet normal { - vert->SetNormal(polys[groups[j].P[k]].Normal.X, - polys[groups[j].P[k]].Normal.Y, - polys[groups[j].P[k]].Normal.Z); + vert->SetNormal(polys[groups[j].P[k]].Normals[i].X, + polys[groups[j].P[k]].Normals[i].Y, + polys[groups[j].P[k]].Normals[i].Z); } else vert->SetNormal(V.Normal.X,V.Normal.Y,V.Normal.Z); } diff --git a/src/r_data/models/models_ue1.h b/src/r_data/models/models_ue1.h index fb67758f7f..be9f57a10b 100644 --- a/src/r_data/models/models_ue1.h +++ b/src/r_data/models/models_ue1.h @@ -89,7 +89,7 @@ private: { int V[3]; FVector2 C[3]; - FVector3 Normal; + TArray Normals; }; struct UE1Group { diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index d5283b26c8..7a6c984361 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -147,7 +147,7 @@ float R_DoomLightingEquation(float light) lightscale = shade - vis; // Result is the normalized colormap index (0 bright .. 1 dark) - return clamp(lightscale, 0.0, 31.0 / 32.0); + return clamp(lightscale, 1.0 - light, 31.0 / 32.0); } //=========================================================================== diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index 1bc3f42a6a..d724c90d9d 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -906,7 +906,17 @@ class Inventory : Actor native return item; } - + + //=========================================================================== + // + // AInventory :: OnDrop + // + // Called by AActor::DropInventory. Allows items to modify how they behave + // after being dropped. + // + //=========================================================================== + + virtual void OnDrop (Actor dropper) {} } //===========================================================================