X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_triggers.pas;h=f89aa9f3de7f89d23c63367c846260100139e9a3;hb=f356426288dc03a804636aaa21c0d7e049e628ac;hp=15575146d572935606c53f43d4d6367fe05866b1;hpb=987c4a835a103345b59937e8e1be8524a6228712;p=d2df-sdl.git diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 1557514..f89aa9f 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -19,7 +19,7 @@ interface uses SysUtils, Variants, Classes, - MAPDEF, e_graphics, g_basic, g_sound, + MAPDEF, g_basic, g_sound, xdynrec, hashtable, exoma; type @@ -105,7 +105,7 @@ uses Math, g_player, g_map, g_panel, g_gfx, g_game, g_textures, g_console, g_monsters, g_items, g_phys, g_weapons, - wadreader, g_main, e_log, g_language, + wadreader, g_main, e_log, g_language, e_res, g_options, g_net, g_netmsg, utils, xparser, xstreams; const @@ -1224,7 +1224,7 @@ begin if not Trigger.Enabled then exit; if (Trigger.TimeOut <> 0) and (actType <> ACTIVATE_CUSTOM) then exit; - if (gLMSRespawn = LMS_RESPAWN_WARMUP) then exit; + if (gLMSRespawn > LMS_RESPAWN_NONE) then exit; if (Trigger.exoCheck <> nil) then begin @@ -1349,17 +1349,13 @@ begin begin Enabled := False; Result := True; - if gLMSRespawn = LMS_RESPAWN_NONE then + p := g_Player_Get(ActivateUID); + p.GetSecret(); + Inc(gCoopSecretsFound); + if g_Game_IsNet then begin - p := g_Player_Get(ActivateUID); - p.GetSecret(); - Inc(gCoopSecretsFound); - if g_Game_IsNet then - begin - MH_SEND_GameStats(); - if p.FClientID >= 0 then - MH_SEND_GameEvent(NET_EV_SECRET, p.UID, ''); - end; + MH_SEND_GameStats(); + MH_SEND_GameEvent(NET_EV_SECRET, p.UID, ''); end; end; @@ -2344,7 +2340,7 @@ end; function g_Triggers_Create (aTrigger: TTrigger; trec: TDynRecord; forceInternalIndex: Integer=-1): DWORD; var find_id: DWORD; - fn, mapw: AnsiString; + fn: AnsiString; f, olen: Integer; ptg: PTrigger; begin @@ -2518,17 +2514,7 @@ begin // Åùå íåò òàêîãî çâóêà if not g_Sound_Exists(ptg.tgcSoundName) then begin - fn := g_ExtractWadName(ptg.tgcSoundName); - if (fn = '') then - begin // Çâóê â ôàéëå ñ êàðòîé - mapw := g_ExtractWadName(gMapInfo.Map); - fn := mapw+':'+g_ExtractFilePathName(ptg.tgcSoundName); - end - else // Çâóê â îòäåëüíîì ôàéëå - begin - fn := GameDir + '/wads/' + ptg.tgcSoundName; - end; - + fn := e_GetResourcePath(WadDirs, ptg.tgcSoundName, g_ExtractWadName(gMapInfo.Map)); //e_LogWritefln('loading trigger sound ''%s''', [fn]); if not g_Sound_CreateWADEx(ptg.tgcSoundName, fn) then begin @@ -2554,18 +2540,7 @@ begin // Åùå íåò òàêîé ìóçûêè if not g_Sound_Exists(ptg.tgcMusicName) then begin - fn := g_ExtractWadName(ptg.tgcMusicName); - - if fn = '' then - begin // Ìóçûêà â ôàéëå ñ êàðòîé - mapw := g_ExtractWadName(gMapInfo.Map); - fn := mapw+':'+g_ExtractFilePathName(ptg.tgcMusicName); - end - else // Ìóçûêà â ôàéëå ñ êàðòîé - begin - fn := GameDir+'/wads/'+ptg.tgcMusicName; - end; - + fn := e_GetResourcePath(WadDirs, ptg.tgcMusicName, g_ExtractWadName(gMapInfo.Map)); if not g_Sound_CreateWADEx(ptg.tgcMusicName, fn, True) then begin g_FatalError(Format(_lc[I_GAME_ERROR_TR_SOUND], [fn, ptg.tgcMusicName])); @@ -2620,8 +2595,9 @@ var begin if (tgMonsList = nil) then tgMonsList := TSimpleMonsterList.Create(); - if gTriggers = nil then - Exit; + if gTriggers = nil then Exit; + if gLMSRespawn > LMS_RESPAWN_NONE then Exit; // don't update triggers at all + SetLength(Affected, 0); for a := 0 to High(gTriggers) do