Warning: Foolish use of GetOwner() Derailed Me

Hello all,

Just wanted to let you know of a foolish mistake I made that caused a hard crash.

In my UE_LOG I used %f and then *(GetOwner()->GetName()) casually without thinking about it. This caused a hard editor crash whenever OnHit registered. I poured through every other thing in my TakeDamage, eventually copying the new code line for line from Git EXCEPT for the UE_LOG.

I figured it might be a new bug with 4.14, I tried a bunch of different things. I should done more than a casual reading of the crash report (GetName was mentioned down below after 20 or so lines) and I should’ve tried commenting out segments in a semi-binary fashion to locate the error.

Just thought I let you know. Tank doesn’t have an owner.

This also applies for both the Player and AI Controllers. Good thing I figured this out through the course timeline.

Privacy & Terms