2017-12-13 23:47 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000211Cheat Enginepublic2013-01-25 23:51
Reportermgr_inz_Player 
Assigned ToDark Byte 
PrioritynormalSeverityminorReproducibilityN/A
StatusresolvedResolutionfixed 
Summary0000211: Timer Class, problem with "sender"
DescriptionThis script launched with CE6.2(old) works:
#########
function testTimer(sender)
  object_destroy(sender)
  print('success')
end

timerObj = createTimer(nil,true)
timer_setInterval(timerObj,1000)
timer_onTimer(timerObj,testTimer)
#########

Plus, I can click "execute script" 10 times per second and nothing bad happens.

But it freezes with 6.2+, sometimes CE gives C stack error.
Maybe I got it wrong. Shouldn't "sender" point to timer object?
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000454

Dark Byte (developer)

It gets the sender, but object_destroy didn't handle the parameter properly

~0000455

mgr_inz_Player (reporter)

Last edited: 2013-01-25 20:09

OK, try this script:
###########
function testTimer(sender)
  print('Output:')

  print('sender', sender )
  print('timerObj', timerObj )

  print('sender classname:', object_getClassName(sender) )
  print('timerObj classname:', object_getClassName(timerObj) )

  if sender~=timerObj then print('sender & timerObj are different')
                      else print('sender & timerObj are the same')
  end

  object_destroy(timerObj)
end

if timerObj~=nil then object_destroy(timerObj);timerObj=nil;end

timerObj = createTimer(nil,true)
timer_setInterval(timerObj,1000)
timer_onTimer(timerObj,testTimer)
###########




old CE6.2 gives this output:
________________________
Output:
sender 000DFDC0
timerObj 000DFDC0
sender classname: TCETimer
timerObj classname: TCETimer
sender & timerObj are the same
________________________




Current CE6.2+ this:
________________________
Output:
sender 000F0410
timerObj
sender classname: TTimer
timerObj classname: TTimer
sender & timerObj are different
________________________



This is what I meant - "sender" <> "timerObj"
btw. you now use TTimer instead of TCETimer ?




Screenshot
http://i.imgur.com/f398a7S.png

~0000457

Dark Byte (developer)

This should be fixed now
+Notes

-Issue History
Date Modified Username Field Change
2013-01-25 07:22 mgr_inz_Player New Issue
2013-01-25 17:02 Dark Byte Note Added: 0000454
2013-01-25 17:02 Dark Byte Status new => resolved
2013-01-25 17:02 Dark Byte Resolution open => fixed
2013-01-25 17:02 Dark Byte Assigned To => Dark Byte
2013-01-25 17:49 mgr_inz_Player Note Added: 0000455
2013-01-25 17:49 mgr_inz_Player Status resolved => feedback
2013-01-25 17:49 mgr_inz_Player Resolution fixed => reopened
2013-01-25 17:56 mgr_inz_Player Note Edited: 0000455
2013-01-25 20:09 mgr_inz_Player Note Edited: 0000455
2013-01-25 23:51 Dark Byte Note Added: 0000457
2013-01-25 23:51 Dark Byte Status feedback => resolved
2013-01-25 23:51 Dark Byte Resolution reopened => fixed
+Issue History