summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 923fa98)
raw | patch | inline | side by side (parent: 923fa98)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 31 Aug 2017 20:17:12 +0000 (23:17 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 1 Sep 2017 00:33:55 +0000 (03:33 +0300) |
src/game/g_map.pas | patch | blob | history | |
src/game/g_triggers.pas | patch | blob | history |
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 1695460c162e06e3b8b36e9c0f3b6b629390cc4a..6ae077b111553f4193f959550e7ac90774e1b670 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
end;
end;
-procedure CreateTrigger(Trigger: TDynRecord; atpanid, ashotpanid: Integer; fTexturePanel1Type, fTexturePanel2Type: Word);
+procedure CreateTrigger(Trigger: TDynRecord; atpanid, atrigpanid: Integer; fTexturePanel1Type, fTexturePanel2Type: Word);
var
_trigger: TTrigger;
begin
Width := Trigger.Width;
Height := Trigger.Height;
Enabled := ByteBool(Trigger.Enabled);
- TexturePanel := Trigger.TexturePanel;
+ //TexturePanel := Trigger.TexturePanel;
+ TexturePanel := atpanid;
TexturePanelType := fTexturePanel1Type;
ShotPanelType := fTexturePanel2Type;
TriggerType := Trigger.TriggerType;
ActivateType := Trigger.ActivateType;
Keys := Trigger.Keys;
- trigPanelId := atpanid;
- trigShotPanelId := ashotpanid;
+ trigPanelId := atrigpanid;
+ //trigShotPanelId := ashotpanid;
//Data.Default := Trigger.DATA;
trigData := Trigger.trigRec.clone();
end;
CurTex, ntn: Integer;
rec, texrec: TDynRecord;
pttit: PTRec;
- pannum, trignum, cnt: Integer;
+ pannum, trignum, cnt, tgpid: Integer;
// key: panel index; value: `TriggersTable` index
hashTextPan: THashIntInt = nil;
hashLiftPan: THashIntInt = nil;
Inc(trignum);
if (TriggersTable[trignum].texPan <> nil) then b := TriggersTable[trignum].texPan.PanelType else b := 0;
if (TriggersTable[trignum].shotPan <> nil) then c := TriggersTable[trignum].shotPan.PanelType else c := 0;
+ tgpid := -1;
+ if (TriggersTable[trignum].LiftPanelIdx <> -1) then tgpid := TriggersTable[trignum].LiftPanelIdx
+ else if (TriggersTable[trignum].DoorPanelIdx <> -1) then tgpid := TriggersTable[trignum].DoorPanelIdx
+ else if (TriggersTable[trignum].ShotPanelIdx <> -1) then tgpid := TriggersTable[trignum].ShotPanelIdx
+ else tgpid := -1;
(*
if (rec.TexturePanel <> -1) then
begin
end;
*)
//e_LogWritefln('creating trigger #%s; texpantype=%s; shotpantype=%s (%d,%d)', [trignum, b, c, TriggersTable[trignum].texPanIdx, TriggersTable[trignum].ShotPanelIdx]);
- CreateTrigger(rec, TriggersTable[trignum].texPanIdx, TriggersTable[trignum].ShotPanelIdx, Word(b), Word(c));
+ CreateTrigger(rec, TriggersTable[trignum].texPanIdx, tgpid, Word(b), Word(c));
end;
end;
index be680ecb8e9f7e4698e3d0648b135d4b737c3d54..47037fc69deaebaeab9d235218b025f3411865ea 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
ShotAmmoCount: Word;
ShotReloadTime: Integer;
- trigShotPanelId: Integer;
+ //trigShotPanelId: Integer;
trigPanelId: Integer;
//TrigData: TTriggerData;
trigData: TDynRecord; // triggerdata; owned by trigger
+
+ property trigShotPanelId: Integer read trigPanelId write trigPanelId;
end;
function g_Triggers_Create(Trigger: TTrigger): DWORD;
find_id := FindTrigger();
gTriggers[find_id] := Trigger;
+ writeln('trigger #', find_id, ': pos=(', Trigger.x, ',', Trigger.y, ')-(', Trigger.width, 'x', Trigger.height, ')',
+ '; TexturePanel=', Trigger.TexturePanel,
+ '; TexturePanelType=', Trigger.TexturePanelType,
+ '; ShotPanelType=', Trigger.ShotPanelType,
+ '; TriggerType=', Trigger.TriggerType,
+ '; ActivateType=', Trigger.ActivateType,
+ '; Keys=', Trigger.Keys,
+ '; trigPanelId=', Trigger.trigPanelId,
+ '; trigShotPanelId=', Trigger.trigShotPanelId
+ );
+
with gTriggers[find_id] do
begin
ID := find_id;