message: added support for FVector floor division
diff: @@ -277,6 +277,24 @@ static PyObject *ue_py_fvector_div(ue_PyFVector *self, PyObject *value)
  return py_ue_new_fvector(vec);
  }
  +static PyObject *ue_py_fvector_floor_div(ue_PyFVector *self, PyObject *value)
  +{
  + FVector vec = self->vec;
  + if (PyNumber_Check(value))
  + {
  + PyObject *f_value = PyNumber_Float(value);
  + float f = PyFloat_AsDouble(f_value);
  + if (f == 0)
  + return PyErr_Format(PyExc_ZeroDivisionError, "division by zero");
  + vec.X = floor(vec.X / f);
  + vec.Y = floor(vec.Y / f);
  + vec.Z = floor(vec.Z / f);
  + Py_DECREF(f_value);
  + return py_ue_new_fvector(vec);
  + }
  + return PyErr_Format(PyExc_TypeError, "value is not numeric");
  +}
  +
  PyNumberMethods ue_PyFVector_number_methods;
  static Py_ssize_t ue_py_fvector_seq_length(ue_PyFVector *self)
  @@ -364,6 +382,7 @@ void ue_python_init_fvector(PyObject *ue_module)
  ue_PyFVector_number_methods.nb_subtract = (binaryfunc)ue_py_fvector_sub;
  ue_PyFVector_number_methods.nb_multiply = (binaryfunc)ue_py_fvector_mul;
  ue_PyFVector_number_methods.nb_true_divide = (binaryfunc)ue_py_fvector_div;
  + ue_PyFVector_number_methods.nb_floor_divide = (binaryfunc)ue_py_fvector_floor_div;
  memset(&ue_PyFVector_sequence_methods, 0, sizeof(PySequenceMethods));
  ue_PyFVectorType.tp_as_sequence = &ue_PyFVector_sequence_methods;
  