Commit Graph

5 Commits (master)

Author SHA1 Message Date
Mark 6cb154fabd UseControl: Prevent possible call on null object
This usually happens in the following case from ClonkControl.ocd/Script.c:

// Release commands are always forwarded even if contents is 0, in case we
// need to cancel use of an object that left inventory
if (contents || (status == CONS_Up && GetUsedObject()))
{
	if (ControlUse2Script(ctrl, x, y, strength, repeat, status, contents))
		return true;
}

It could also be necessary that, instead of contents, either "this", or GetUsedObject() should be passed. Not sure which one was intended.
2017-06-21 00:06:12 +02:00
Mark 38648dedcc UseControl: #1873 Prevent use while a menu is opened.
Using objects was blocked by the GUI menus and the ObjectControl() function anyway, but (!) it was not blocked for the old style menus that can still be used.
2017-01-13 00:05:35 +01:00
Mark 92e53fe09f UseControl: Merge the two if-blocks that share the same condition 2017-01-12 23:58:38 +01:00
Mark 83486fceb8 Control: Format scripts 2017-01-03 18:04:10 +01:00
Mark 39c54c323c Control: Extract library for using objects
External packs use this functionality without using the whole default Clonk control.
2017-01-03 18:03:32 +01:00