mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-30 23:15:32 +01:00 
			
		
		
		
	Allow nil puncher in object:punch (#14319)
				
					
				
			This commit is contained in:
		| @@ -5729,7 +5729,7 @@ Call these functions only at load time! | ||||
|     * Called when a player is punched | ||||
|     * Note: This callback is invoked even if the punched player is dead. | ||||
|     * `player`: ObjectRef - Player that was punched | ||||
|     * `hitter`: ObjectRef - Player that hit | ||||
|     * `hitter`: ObjectRef - Player that hit. Can be nil. | ||||
|     * `time_from_last_punch`: Meant for disallowing spamming of clicks | ||||
|       (can be nil). | ||||
|     * `tool_capabilities`: Capability table of used item (can be nil) | ||||
| @@ -7825,11 +7825,11 @@ child will follow movement and rotation of that bone. | ||||
|     * no-op if object is attached | ||||
| * `punch(puncher, time_from_last_punch, tool_capabilities, dir)` | ||||
|     * punches the object, triggering all consequences a normal punch would have | ||||
|     * `puncher`: another `ObjectRef` which punched the object | ||||
|     * `puncher`: another `ObjectRef` which punched the object or `nil` | ||||
|     * `dir`: direction vector of punch | ||||
|     * Other arguments: See `on_punch` for entities | ||||
|     * All arguments except `puncher` can be `nil`, in which case a default | ||||
|       value will be used | ||||
|     * Arguments `time_from_last_punch`, `tool_capabilities`, and `dir` | ||||
|       will be replaced with a default value when the caller sets them to `nil`. | ||||
| * `right_click(clicker)`: | ||||
|     * simulates using the 'place/use' key on the object | ||||
|     * triggers all consequences as if a real player had done this | ||||
|   | ||||
		Reference in New Issue
	
	Block a user