function wallgun_slot_2D() /* entry=396 class_id=0x0A1A slot=0x2D */
{
  var
    referent, /* [BP+00h] type=0x69 */
    target, /* [BP+0Ah] type=0x69 */
    targItem, /* [BP-02h] type=0x24 */
    coordToCoordDir, /* [BP-04h] type=0x69 */
    left, /* [BP-06h] type=0x69 */
    right, /* [BP-08h] type=0x69 */
    dir; /* [BP-0Ah] type=0x69 */

  targItem = target;
  coordToCoordDir = Item.getDirFromTo16(Item.getY(targItem), Item.getX(targItem), Item.getY(arg_06), Item.getX(arg_06));
  class_0A1A_slot_2C(arg_06);
  if (retval == coordToCoordDir) {
    return;
  }
  else {
    class_0A1A_slot_29(arg_06);
    if (!retval) {
      class_0A1A_slot_2C(arg_06);
      dir = retval;
      left = 0;
      right = 0;
      while ((dir == coordToCoordDir) && (left < 15)) {
        left = (1 + left);
        if (dir == 0) {
          dir = 15;
        }
        else {
          dir = (dir - 1);
        }
      }
      class_0A1A_slot_2C(arg_06);
      dir = retval;
      while ((dir == coordToCoordDir) && (right < 15)) {
        right = (1 + right);
        if (dir == 15) {
          dir = 0;
        }
        else {
          dir = (1 + dir);
        }
      }
      if (left >= right) {
        return;
      }
    }
    else {
      class_0A1A_slot_2A(arg_06);
      if (((retval == 1) && (coordToCoordDir >= 13)) && (coordToCoordDir <= 15)) {
        return;
      }
      class_0A1A_slot_2C(arg_06);
      if (retval <= coordToCoordDir) {
        return;
      }
    }
    return;
  }
  return;
}
