Carrots cannot be buried in the ground with toaster

Version:

1.0

Added on:

15 Apr 2014 11:28

Tags:

Description:
What the title says. It has come to my knowledge that in some levels, it is possible to use toaster to "bury" objects such as carrots so that they are permanently out of reach. This snippet acts as a quick solution to that issue.
void onLevelLoad() {
  jjObjectPresets[OBJECT::CARROT].behavior = CantBeBuried;
  jjObjectPresets[OBJECT::FULLENERGY].behavior = CantBeBuried;
}

void CantBeBuried(jjOBJ@ obj) {
  obj.behave(BEHAVIOR::PICKUP);
  if (jjMaskedPixel(obj.xPos, obj.yPos + 8)) {
    obj.state = STATE::FLOAT;
  }
}