forked from phenom/healer-man
16 lines
853 B
JavaScript
16 lines
853 B
JavaScript
/** Mirrors BuildWaterBodyMaterial's branch without assigning names to raw 4. */
|
|
export function nativeWaterRenderPolicy(descriptor) {
|
|
const property = descriptor.baseObject?.properties?.find(row => row.name === "waterDesc:full:enable");
|
|
if (property && (property.type !== 2 || !Number.isInteger(property.value))) {
|
|
throw new Error("Native water full-model enable must be a serialized BOOL.");
|
|
}
|
|
const fullModelRequested = property ? property.value !== 0 : false;
|
|
const eligibleBody = descriptor.bodyType === 0 || descriptor.bodyType === 2;
|
|
return {
|
|
fullModelEnabled: eligibleBody && descriptor.effectType !== 2 && fullModelRequested,
|
|
bodyTypeRaw: descriptor.bodyType,
|
|
fullModelRequested,
|
|
sourceBranch: "NORMAL/SOLID body, non-DIRECT effect, waterDesc:full:enable; browser enables reflection/refraction together",
|
|
};
|
|
}
|