admin 发表于 2018-4-23 07:14:12

飞尔引擎20120918抖动漏洞感谢E-X新星20161020修复光圈

20120918 飞尔抖动漏洞修复 CQFIR
请注意开头procedure TPlayScene.Run(RunSelf: Boolean); 直接把这句换成procedure TPlayScene.Run();结尾 g_dwRefreshMessagesTick := GetTickCount();注解掉 就没问题了



procedure TPlayScene.Run(RunSelf: Boolean);   
var
I, k, drawingbottomline: Integer;
movetick: Boolean;
evn: TEvent;
Actor: TActor;
meff: TMagicEff;

dwCheckTime, dwTestCheckTime: LongWord;
nIdx: Integer;
boCheckTimeLimit: Boolean;
nCheckCode: Integer;
dwStepMoveTime: LongWord;

dwTickTime: LongWord;
begin
drawingbottomline := 0;
if (g_MySelf = nil) then begin
    Exit;
end;

g_boDoFastFadeOut := FALSE;

movetick := FALSE;
if GetTickCount - m_dwMoveTime >= 100 then begin
    m_dwMoveTime := GetTickCount;
    movetick := True;
    Inc(m_nMoveStepCount);
    if m_nMoveStepCount > 1 then m_nMoveStepCount := 0;
end;
if GetTickCount - m_dwAniTime >= 50 then begin
    m_dwAniTime := GetTickCount;
    Inc(m_nAniCount);
    if m_nAniCount > 100000 then m_nAniCount := 0;
end;
try
    I := 0;
    while True do begin
      if I >= m_ActorList.count then Break;
      Actor := m_ActorList;
      if movetick then Actor.m_boLockEndFrame := FALSE;
      if not Actor.m_boLockEndFrame then begin
      Actor.ProcMsg;
      if movetick then
          if Actor.Move(m_nMoveStepCount) then begin
            Inc(I);
            Continue;
          end;
      Actor.Run; //
      if Actor <> g_MySelf then Actor.ProcHurryMsg;
      end;
      if Actor = g_MySelf then Actor.ProcHurryMsg;
      //
      if Actor.m_nWaitForRecogId <> 0 then begin
      if Actor.IsIdle then begin
          DelChangeFace(Actor.m_nWaitForRecogId);
          NewActor(Actor.m_nWaitForRecogId, Actor.m_nCurrX, Actor.m_nCurrY, Actor.m_btDir, Actor.m_nWaitForFeature, Actor.m_nWaitForStatus);
          Actor.m_nWaitForRecogId := 0;
          Actor.m_boDelActor := True;
      end;
      end;
      if Actor.m_boDelActor then begin
      g_FreeActorList.Add(Actor);
      m_ActorList.Delete(I);
      if g_TargetCret = Actor then g_TargetCret := nil;
      if g_FocusCret = Actor then g_FocusCret := nil;
      if g_MagicTarget = Actor then g_MagicTarget := nil;
      end else
      Inc(I);
    end;
except
    DebugOutStr('101');
end;

try
    I := 0;
    while True do begin
      if I >= m_GroundEffectList.count then Break;
      meff := m_GroundEffectList;
      if meff.m_boActive then begin
      if not meff.Run then begin
          meff.Free;
          m_GroundEffectList.Delete(I);
          Continue;
      end;
      end;
      Inc(I);
    end;
    I := 0;
    while True do begin
      if I >= m_EffectList.count then Break;
      meff := m_EffectList;
      if meff.m_boActive then begin
      if not meff.Run then begin
          meff.Free;
          m_EffectList.Delete(I);
          Continue;
      end;
      end;
      Inc(I);
    end;
    I := 0;
    while True do begin
      if I >= m_FlyList.count then Break;
      meff := m_FlyList;
      if meff.m_boActive then begin
      if not meff.Run then begin
          meff.Free;
          m_FlyList.Delete(I);
          Continue;
      end;
      end;
      Inc(I);
    end;

    EventMan.Execute;
except
    DebugOutStr('102');
end;

try
//清除超过显示范围的物品数据
    ClearDropItem();
//清除超过显示范围的魔法数据
    for k := EventMan.EventList.Count - 1 downto 0 do begin
      evn := TEvent(EventMan.EventList);
      if ((abs(evn.m_nX - g_MySelf.m_nCurrX) > 30) and (abs(evn.m_nY - g_MySelf.m_nCurrY) > 30)) or (not evn.m_boVisible) then begin
      EventMan.EventList.Delete(k);
      evn.Free;
      //Break;
      end;
    end;                        //以上是原版 安全区 魔法光圈 小斌在线(1115711700)修改
    for k := 0 to EventMan.EventList.count - 1 do begin //播放烟花声音
      evn := TEvent(EventMan.EventList);
      if (abs(evn.m_nX - g_MySelf.m_nCurrX) <= 30) or (abs(evn.m_nY - g_MySelf.m_nCurrY) <= 30) then begin
      if evn.m_nEventType in then begin
          if TFlowerEvent(evn).m_nExplosionSound > 0 then begin
            PlaySound(TFlowerEvent(evn).m_nExplosionSound);
            TFlowerEvent(evn).m_nExplosionSound := -2;
          end;
      end;
      end;
    end;
except
    DebugOutStr('103');
end;
g_dwRefreshMessagesTick := GetTickCount();
end;


页: [1]
查看完整版本: 飞尔引擎20120918抖动漏洞感谢E-X新星20161020修复光圈