summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd99178)
raw | patch | inline | side by side (parent: fd99178)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 13 Dec 2019 20:45:34 +0000 (23:45 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 13 Dec 2019 20:45:34 +0000 (23:45 +0300) |
src/editor/f_main.pas | patch | blob | history | |
src/shared/MAPWRITER.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 225daecbb528255b4ad1c689dcdb14b2e59d705d..1d1d2ce5da316808b4db68c1e3fb168ed1ac12f8 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
if vleObjectProperty.Values[_lc[I_PROP_TR_MUSIC_ACT]] = _lc[I_PROP_TR_MUSIC_ON] then
Data.MusicAction := 1
else
- Data.MusicAction := 2;
+ Data.MusicAction := 0;
end;
TRIGGER_PUSH:
index 4c7a6379b179c4c1bbe008e28d45c10eaa45dad2..95a181d0f056596e37b7b0650173777b8fe9f502 100644 (file)
--- a/src/shared/MAPWRITER.pas
+++ b/src/shared/MAPWRITER.pas
implementation
uses
- BinEditor, SysUtils;
+ MAPDEF, BinEditor, SysUtils, Math;
{ TMapWriter }
function TMapWriter_1.AddTriggers(Triggers: TTriggersRec1Array): Boolean;
var
- a, size: LongWord;
+ a, i, size: LongWord;
+ tr: ^TTriggerData;
begin
if Triggers = nil then
begin
Exit;
end;
+ // fix broken maps
+ for i := 0 to High(Triggers) do
+ begin
+ tr := @Triggers[i].data;
+ case Triggers[i].TriggerType of
+ TRIGGER_MUSIC: tr.MusicAction := Min(Max(tr.MusicAction, 0), 1);
+ end
+ end;
+
SetLength(FDataBlocks, Length(FDataBlocks)+1);
size := SizeOf(TTriggerRec_1);