[Bf-blender-cvs] [320fc70cf22] master: Minor template code patch. (objectHitList =/= hitObjectList)
Aaron Carlisle
noreply at git.blender.org
Wed Jul 26 22:06:32 CEST 2017
Commit: 320fc70cf223ba3d8c3822302d5f353861278089
Author: Aaron Carlisle
Date: Wed Jul 26 15:56:43 2017 -0400
Branches: master
https://developer.blender.org/rB320fc70cf223ba3d8c3822302d5f353861278089
Minor template code patch. (objectHitList =/= hitObjectList)
The Blender text editor's built in python template "Gamelogic" has a reference near the bottom to "objectHitList" as an alleged attribute to the KX_TouchSensor. This name is incorrect, it's correct name is "hitObjectList."
Attempting to access the suggested objectHitList returns error...
```
AttributeError: 'KX_TouchSensor' object has no attribute 'objectHitList'
```
The provided diff corrects this minor error.
Reviewers: kupoman, moguri, campbellbarton, Blendify
Reviewed By: Blendify
Tags: #game_engine, #game_python
Differential Revision: https://developer.blender.org/D2748
===================================================================
M release/scripts/templates_py/gamelogic.py
===================================================================
diff --git a/release/scripts/templates_py/gamelogic.py b/release/scripts/templates_py/gamelogic.py
index 01ac27c56cd..e589ad43e63 100644
--- a/release/scripts/templates_py/gamelogic.py
+++ b/release/scripts/templates_py/gamelogic.py
@@ -62,7 +62,7 @@ def main():
# adding to our objects "life" property
"""
actu_collide = cont.sensors["collision_sens"]
- for ob in actu_collide.objectHitList:
+ for ob in actu_collide.hitObjectList:
# Check to see the object has this property
if "life" in ob:
own["life"] += ob["life"]
More information about the Bf-blender-cvs
mailing list