index ec3bb7144f67e6ae7f1c2f05c62890134968af8a..4fefb5d34b612cda301c2ed28f1734235b8e8867 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
with gWalls[PanelID] do
begin
if g_CollidePlayer(X, Y, Width, Height) or
- g_CollideMonster(X, Y, Width, Height) then Exit;
+ g_Mons_IsAnyAliveAt(X, Y, Width, Height) then Exit;
if not Enabled then
begin
with gWalls[gDoorMap[c, b]] do
begin
if g_CollidePlayer(X, Y, Width, Height) or
- g_CollideMonster(X, Y, Width, Height) then Exit;
+ g_Mons_IsAnyAliveAt(X, Y, Width, Height) then Exit;
end;
if not NoSound then
if Data.ItemMax > 0 then
begin
- it := g_ItemByIdx(iid);
+ it := g_Items_ByIdx(iid);
it.SpawnTrigger := ID;
Inc(SpawnedCount);
end;
case Data.ItemEffect of
EFFECT_TELEPORT: begin
- it := g_ItemByIdx(iid);
+ it := g_Items_ByIdx(iid);
if g_Frames_Get(FramesID, 'FRAMES_TELEPORT') then
begin
Anim := TAnimation.Create(FramesID, False, 3);
NET_GFX_TELE);
end;
EFFECT_RESPAWN: begin
- it := g_ItemByIdx(iid);
+ it := g_Items_ByIdx(iid);
if g_Frames_Get(FramesID, 'FRAMES_ITEM_RESPAWN') then
begin
Anim := TAnimation.Create(FramesID, False, 4);
NET_GFX_RESPAWN);
end;
EFFECT_FIRE: begin
- it := g_ItemByIdx(iid);
+ it := g_Items_ByIdx(iid);
if g_Frames_Get(FramesID, 'FRAMES_FIRE') then
begin
Anim := TAnimation.Create(FramesID, False, 4);
a, b, i: Integer;
Affected: array of Integer;
- function monsNear (monidx: Integer; mon: TMonster): Boolean;
+ {function monsNear (monidx: Integer; mon: TMonster): Boolean;
begin
result := false; // don't stop
if mon.Collide(gTriggers[a].X, gTriggers[a].Y, gTriggers[a].Width, gTriggers[a].Height) then
gTriggers[a].ActivateUID := mon.UID;
ActivateTrigger(gTriggers[a], ACTIVATE_MONSTERCOLLIDE);
end;
+ end;}
+
+ function monsNear (monidx: Integer; mon: TMonster): Boolean;
+ begin
+ result := false; // don't stop
+ gTriggers[a].ActivateUID := mon.UID;
+ ActivateTrigger(gTriggers[a], ACTIVATE_MONSTERCOLLIDE);
end;
begin
if ByteBool(ActivateType and ACTIVATE_MONSTERCOLLIDE) and
(TimeOut = 0) and (Keys = 0) then // Åñëè íå íóæíû êëþ÷è
begin
- g_Mons_ForEach(monsNear);
+ //g_Mons_ForEach(monsNear);
+ g_Mons_ForEachAt(gTriggers[a].X, gTriggers[a].Y, gTriggers[a].Width, gTriggers[a].Height, monsNear);
end;
// "Ìîíñòðîâ íåò"
if ByteBool(ActivateType and ACTIVATE_NOMONSTER) and
(TimeOut = 0) and (Keys = 0) then
- if not g_CollideMonster(X, Y, Width, Height) then
+ if not g_Mons_IsAnyAliveAt(X, Y, Width, Height) then
begin
gTriggers[a].ActivateUID := 0;
ActivateTrigger(gTriggers[a], ACTIVATE_NOMONSTER);