Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: vonchor on September 13, 2011, 03:34:49 PM

Title: Bug in "StringContains" and "StringCompare" [FIXED]
Post by: vonchor on September 13, 2011, 03:34:49 PM
This drove me nuts for a few hours till I realized it wasn't me!  :o

This action (and StringCompare as well) fail in the case where you are only looking for the "False Event" condition. If you only have an event set up for the false condition then it always is sent regardless of the status of the comparison. That's because of the logic construct in DoStringContains which doesn't test for the false condition. So if you have String Contains without an "True Event" (i.e., it's null) but only a "False Event" then the logic that sends events doesn't work right.

Same problem in StringCompare but the variable names are different.

Here's a fix for String Contains.

Code: [Select]

if (contains && trueEvent != null) {

if (!contains && falseEvent != null)

I suppose the "return" in the first test isn't absolutely needed but it's a tiny bit more efficient.
Title: Re: Bug in "StringContains" and "StringCompare"
Post by: Alex Chouls on September 18, 2011, 07:38:21 AM
Thanks vonchor! I've added this to the 1.2.1 update.