Twinki
2013-07-03 16:41:15
I've made a kinda ghetto DTM counter for an RSPS, but the problem is I keep getting a bunch of 'The following DTM's were not freed' messages in the debug.
Sometimes it'll be a lot more.
Basically all it does is count how many LividPlant DTM's are in my inventory and returns the count. (Had to add the divide by 9 because for some reason the numbers kept returning as 9 * the actual Inventory count) Also I couldn't use any of the functions like CountItemsIn because they wouldn't work with the RSPS.
Anyways, I did add FreeDTM(LividPlant); to the main loop and it still didn't fix the problem.
The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9]Sometimes it'll be a lot more.
procedure CountLividPlants;
var
thisTPA:TPointArray;
LividPlant, P:Integer;
begin
LividPlant := DTMFromString('mggAAAHicY2NgYChlYmBIhOJsIK4G4jIgfgmUuwnED4H4IxC/B+I7QFwZ7gIkmTAwKwN2wIgDQwAAeEIJLg==');
wait(500);
FindDTMs(LividPlant, thisTPA, RL_MIX1, RL_MIY1, RL_MIX2, RL_MIY2);
P := Length(thisTPA);
Plants := P / 9
writeln(IntToStr(Plants));
end; Basically all it does is count how many LividPlant DTM's are in my inventory and returns the count. (Had to add the divide by 9 because for some reason the numbers kept returning as 9 * the actual Inventory count) Also I couldn't use any of the functions like CountItemsIn because they wouldn't work with the RSPS.
Anyways, I did add FreeDTM(LividPlant); to the main loop and it still didn't fix the problem.