View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000051 | Gameplay + OpenGL | [All Projects] Bug | public | 2017-01-14 21:00 | 2017-01-15 03:47 |
Reporter | Major Cooke | ||||
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Summary | 0000051: Pointer issues | ||||
Description | Image D4D.pk3 D4DResources.pk3 The pinatas from killing enemies with the chainsaw altfire just hang around instead of disappearing. The code: Class D4PinataBorder : Actor { Default { +NOINTERACTION +BRIGHT +FORCEXYBILLBOARD Scale 0.3; DistanceCheck "user_MaxDrawDistance"; } States { Spawn: TNT1 A 0 NoDelay { if (!master) { OnDestroy(); return ResolveState(null); } if (master.GetClass() == "D4PinataArmor") { return ResolveState(1); } if (master.GetClass() == "D4PinataHealth") { return ResolveState(2); } if (master is "D4Carrion") { return ResolveState(3); } if (master is "D4BFGAmmo") { return ResolveState(4); } if (master is "Ammo") { return ResolveState(3); } return ResolveState("Null"); } PIN3 ABDH 0 A_Jump(256,"Enact"); Enact: "####" "#" 1 { if (!master) { OnDestroy(); return; } A_Warp(MasterPtr,0,0,5,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE|WARPF_COPYVELOCITY,"Null"); } Loop; } } | ||||
Tags | No tags attached. | ||||
Forgot to set this as 'major' instead of 'minor'. | |
...Hmmm. I think it's something to do with the recent Ammo scriptifying. | |
Okay, updated to the latest with the health changes. It happens to those too. | |
You have to call 'Destroy' not 'OnDestroy'. 'OnDestroy' is just a callback to report that the item is about to be destroyed but does nothing itself, hence the 'On...' in the name. For technical reasons it is not possible to make 'Destroy' itself virtual because that'd badly crash an engine shutdown. | |
The original problem was solved, so it could be possible to try again to make Destroy virtual... | |
I already solved the problem by making the cleanup function something that is being called by the actual Destroy method. This is absolutely necessary here, because Destroy can be called after the class table cleanup where a virtual scripted call will thoroughly crash the engine if not done properly and that means keeping code execution under tight control. The original implementation was something I never liked because it depended on everybody implementing it properly, if just one intermediate class forgets to call the super method big problems would ensue. This cannot happen anymore. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2017-01-14 21:00 | Major Cooke | New Issue | |
2017-01-14 21:01 | Major Cooke | Note Added: 0000083 | |
2017-01-14 21:42 | Major Cooke | Note Added: 0000084 | |
2017-01-14 22:06 | Major Cooke | Note Added: 0000085 | |
2017-01-15 02:38 | Graf Zahl | Note Added: 0000086 | |
2017-01-15 02:38 | Graf Zahl | Status | new => resolved |
2017-01-15 02:38 | Graf Zahl | Resolution | open => no change required |
2017-01-15 03:24 | Edward-san | Note Added: 0000087 | |
2017-01-15 03:47 | Graf Zahl | Note Added: 0000088 |